V8 Javascript API

Scope Class Reference

[Utility]

Description

A class for managing scopes

Constructor

 Scope( String name, String parent_scope, number privacy_level, bool create)
More...

Functions

Scope create_child( String name, number privacy_level)
Creates and returns a child scope of this scope. More...
 delete()
Delete this scope.
 use()
Use this scope.

Static Functions

Scope current()
Returns the current scope. More...
Scope global()
Returns the global scope. More...

Properties

bool  exists
Returns whether the scope exists or not.
String  name
The name of the scope. More...
Scope parent
The parent scope of this scope.

Constructor

Scope( String name, String parent_scope, number privacy_level, bool create)

Parameters

name
The name of the scope
parent_scope
if create is true then the name of the parent scope. Defaults to the global scope
privacy_level
if create is true then the privacy level to create the scope at. Defaults to privacy level of the parent scope + 1.
create
if true then create the scope, otherwise it is assumed it already exists

Functions

Scope Scope.create_child( String name, number privacy_level)

Creates and returns a child scope of this scope.

Parameters

name
The name of the scope
privacy_level
if create is true then the privacy level to create the scope at. Defaults to privacy level of the parent scope + 1.
Scope Scope.current() [static]

Returns the current scope.

Scope.delete()

Delete this scope.

Scope Scope.global() [static]

Returns the global scope.

Scope.use()

Use this scope.

Properties

bool Scope.exists

Returns whether the scope exists or not.

String Scope.name

The name of the scope. Read only.

Scope Scope.parent

The parent scope of this scope.