#include <interpreter.h>
Public Methods | |
| const List | scopeChain () const |
| Object | variableObject () const |
| Object | thisValue () const |
| const Context | callingContext () const |
An execution context contains information about the current state of the script - the scope for variable lookup, the value of "this", etc. A new execution context is entered whenever global code is executed (e.g. with Interpreter::evaluate()), a function is called (see Object::call()), or the builtin "eval" function is executed.
Most inheritable functions in the KJS api take a ExecState pointer as their first parameter. This can be used to obtain a handle to the current execution context.
Note: Context objects are wrapper classes/smart pointers for the internal KJS ContextImp type. When one context variable is assigned to another, it is still referencing the same internal object.
Definition at line 56 of file interpreter.h.
|
|
Returns the context from which the current context was invoked. For global code this will be a null context (i.e. one for which isNull() returns true). You should check isNull() on the returned value before calling any of it's methods.
|
|
|
Returns the scope chain for this execution context. This is used for variable lookup, with the list being searched from start to end until a variable is found.
|
|
|
Returns the "this" value for the execution context. This is the value returned when a script references the special variable "this". It should always be an Object, unless application-specific code has passed in a different type. The object that is used as the "this" value depends on the type of execution context - for global contexts, the global object is used. For function objewcts, the value is given by the caller (e.g. in the case of obj.func(), obj would be the "this" value). For code executed by the built-in "eval" function, the this value is the same as the calling context.
|
|
|
Returns the variable object for the execution context. This contains a property for each variable declared in the execution context.
|
1.2.18