KJS-API
#include <kjsinterpreter.h>
Public Member Functions | |
| KJSInterpreter () | |
| KJSInterpreter (const KJSGlobalObject &global) | |
| KJSInterpreter (const KJSInterpreter &other) | |
| ~KJSInterpreter () | |
| KJSResult | evaluate (const QString &code, KJSObject *thisValue=0) |
| KJSResult | evaluate (const QString &sourceURL, int startingLineNumber, 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() [1/3]
| KJSInterpreter::KJSInterpreter | ( | ) |
Constructs an interpreter with a default global object.
Definition at line 88 of file kjsinterpreter.cpp.
◆ KJSInterpreter() [2/3]
| KJSInterpreter::KJSInterpreter | ( | const KJSGlobalObject & | global | ) |
Constructs an interpreter with a custom global object.
Definition at line 96 of file kjsinterpreter.cpp.
◆ KJSInterpreter() [3/3]
| KJSInterpreter::KJSInterpreter | ( | const KJSInterpreter & | other | ) |
Creates a copy of another interpreter.
Definition at line 112 of file kjsinterpreter.cpp.
◆ ~KJSInterpreter()
| 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
◆ evaluate() [1/2]
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.
◆ evaluate() [2/2]
| 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.
◆ globalContext() [1/2]
| KJSContext * KJSInterpreter::globalContext | ( | ) |
Returns a handle to the global execution context.
Definition at line 148 of file kjsinterpreter.cpp.
◆ globalContext() [2/2]
| 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.
◆ globalObject()
| 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.
◆ normalizeCode()
|
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
-
codeIn The code to be reformatted codeOut Points to string holding the result. errLine Will hold the line of a parse error errMsg Will 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.
◆ operator=()
| 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:
Documentation copyright © 1996-2026 The KDE developers.
Generated on by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.