.TH "KJS::Context" 3 "28 Jan 2004" "kjs Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KJS::Context \- Represents an execution context, as specified by section 10 of the ECMA spec.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <interpreter.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBContext\fP (\fBContextImp\fP *)"
.br
.ti -1c
.RI "\fBContext\fP (const  \fBContext\fP &c)"
.br
.ti -1c
.RI "\fBContext\fP & \fBoperator=\fP (const  \fBContext\fP &c)"
.br
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.ti -1c
.RI "\fBContextImp\fP * \fBimp\fP () const "
.br
.ti -1c
.RI "const  \fBList\fP \fBscopeChain\fP () const "
.br
.RI "\fIReturns the scope chain for this execution context. \fP"
.ti -1c
.RI "\fBObject\fP \fBvariableObject\fP () const "
.br
.RI "\fIReturns the variable object for the execution context. \fP"
.ti -1c
.RI "\fBObject\fP \fBthisValue\fP () const "
.br
.RI "\fIReturns the 'this' value for the execution context. \fP"
.ti -1c
.RI "const  \fBContext\fP \fBcallingContext\fP () const "
.br
.RI "\fIReturns the context from which the current context was invoked. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Represents an execution context, as specified by section 10 of the ECMA spec. 

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 \fBInterpreter::evaluate\fP()), a function is called (see \fBObject::call\fP()), or the builtin 'eval' function is executed.
.PP
Most inheritable functions in the KJS api take a \fBExecState\fP pointer as their first parameter. This can be used to obtain a handle to the current execution context.
.PP
Note: \fBContext\fP objects are wrapper classes/smart pointers for the internal KJS \fBContextImp\fP type. When one context variable is assigned to another, it is still referencing the same internal object. 
.PP
Definition at line 56 of file interpreter.h.
.SH "Member Function Documentation"
.PP 
.SS "const  \fBList\fP Context::scopeChain () const"
.PP
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.
.PP
\fBReturns:\fP
.RS 4
The execution context's scope chain 
.RE
.PP
Definition at line 74 of file interpreter.cpp.
.PP
References KJS::ContextImp::scopeChain().
.SS "\fBObject\fP Context::variableObject () const"
.PP
Returns the variable object for the execution context. This contains a property for each variable declared in the execution context.
.PP
\fBReturns:\fP
.RS 4
The execution context's variable object 
.RE
.PP
Definition at line 79 of file interpreter.cpp.
.PP
References KJS::ContextImp::variableObject().
.SS "\fBObject\fP Context::thisValue () const"
.PP
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 \fBObject\fP, unless application-specific code has passed in a different type.
.PP
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.
.PP
\fBReturns:\fP
.RS 4
The execution context's 'this' value 
.RE
.PP
Definition at line 84 of file interpreter.cpp.
.PP
References KJS::ContextImp::thisValue().
.SS "const  \fBContext\fP Context::callingContext () const"
.PP
Returns the context from which the current context was invoked. For global code this will be a null context (i.e. one for which \fBisNull\fP() returns true). You should check \fBisNull\fP() on the returned value before calling any of it's methods.
.PP
\fBReturns:\fP
.RS 4
The calling execution context 
.RE
.PP
Definition at line 89 of file interpreter.cpp.
.PP
References KJS::ContextImp::callingContext().

.SH "Author"
.PP 
Generated automatically by Doxygen for kjs Library from the source code.
