• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KJS-API

Public Member Functions | Static Public Member Functions | List of all members
KJSInterpreter Class Reference

#include <kjsinterpreter.h>

Public Member Functions

 KJSInterpreter ()
 
 KJSInterpreter (const KJSGlobalObject &global)
 
 KJSInterpreter (const KJSInterpreter &other)
 
 ~KJSInterpreter ()
 
KJSResult evaluate (const QString &sourceURL, int startingLineNumber, const QString &code, KJSObject *thisValue=0)
 
KJSResult evaluate (const QString &code, KJSObject *thisValue=0)
 
KJSContext * globalContext ()
 
const KJSContext * globalContext () const
 
KJSObject globalObject ()
 
KJSInterpreter & operator= (const KJSInterpreter &other)
 

Static Public Member Functions

static bool normalizeCode (const QString &codeIn, QString *codeOut, int *errLine=0, QString *errMsg=0)
 

Detailed Description

A class representing a JavaScript interpreter.

JavaScript interpreter

Definition at line 82 of file kjsinterpreter.h.

Constructor & Destructor Documentation

KJSInterpreter::KJSInterpreter ( )

Constructs an interpreter with a default global object.

Definition at line 88 of file kjsinterpreter.cpp.

KJSInterpreter::KJSInterpreter ( const KJSGlobalObject &  global)

Constructs an interpreter with a custom global object.

Definition at line 96 of file kjsinterpreter.cpp.

KJSInterpreter::KJSInterpreter ( const KJSInterpreter &  other)

Creates a copy of another interpreter.

Definition at line 112 of file kjsinterpreter.cpp.

KJSInterpreter::~KJSInterpreter ( )

Destructs this interpreter and frees resources it has allocated.

This renders any still existing objects referencing those invalid.

Definition at line 141 of file kjsinterpreter.cpp.

Member Function Documentation

KJSResult KJSInterpreter::evaluate ( const QString &  sourceURL,
int  startingLineNumber,
const QString &  code,
KJSObject *  thisValue = 0 
)

Evaluates a piece of code with a "this" set to (optionally set) value.

The sourceURL and startingLineNumber parameters are used to provide information about the origin of a parse error or runtime exception.

Definition at line 163 of file kjsinterpreter.cpp.

KJSResult KJSInterpreter::evaluate ( const QString &  code,
KJSObject *  thisValue = 0 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 197 of file kjsinterpreter.cpp.

KJSContext * KJSInterpreter::globalContext ( )

Returns a handle to the global execution context.

Definition at line 148 of file kjsinterpreter.cpp.

const KJSContext* KJSInterpreter::globalContext ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

KJSObject KJSInterpreter::globalObject ( )

Returns the object that is used as the global object during all script execution performed by this interpreter,.

Definition at line 156 of file kjsinterpreter.cpp.

bool KJSInterpreter::normalizeCode ( const QString &  codeIn,
QString *  codeOut,
int *  errLine = 0,
QString *  errMsg = 0 
)
static

Reformat the given script code to an easy to read format with only one statement per line.

This can be useful when debugging a script that was e.g. condensed into a single line to a single line. While comments will be removed the script will remain unchanged semantically.

Parameters
codeInThe code to be reformatted
codeOutPoints to string holding the result.
errLineWill hold the line of a parse error
errMsgWill hold the message of a parse error
Returns
Returns true if the reformatting was successful, false on a parse error.

Definition at line 203 of file kjsinterpreter.cpp.

KJSInterpreter & KJSInterpreter::operator= ( const KJSInterpreter &  other)

Assign another interpreter instance to this object.

Definition at line 121 of file kjsinterpreter.cpp.


The documentation for this class was generated from the following files:
  • kjsinterpreter.h
  • kjsinterpreter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KJS-API

Skip menu "KJS-API"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal