mrdocs::js::Scope

A JavaScript scope

Synopsis

Declared in <mrdocs/Support/JavaScript.hpp>

class Scope;

Member Functions

Name

Description

Scope [constructor]

Constructor.

~Scope [destructor]

Destructor.

compile_function

Compile a script and push results to stack.

compile_script

Compile a script and push results to stack.

eval

Compile and run a expression.

getGlobal

Return a global object if it exists.

getGlobalObject

Return the global object.

pushArray

Push a new array to the stack

pushBoolean

Push a boolean to the stack

pushDouble

Push a double to the stack

pushInteger

Push an integer to the stack

pushObject

Push a new object to the stack

pushString

Push a string to the stack

script

Compile and run a script.

setGlobal

Set a global object.

Friends

Name

Description

mrdocs::js::Access

Description

This class represents a JavaScript scope under which we can define variables and execute scripts.

Each scope is a section of the context heap in the JavaScript interpreter. A javascript variable is defined by creating a Value that is associated with this Scope, i.e., subsection of the context heap.

When a scope is destroyed, the heap section is popped and all variables defined in that scope are invalidated.

For this reason, two scopes of the same context heap cannot be manipulated at the same time.

Created with MrDocs