Class: Scope

Scope

new Scope()

Source:

Members

block :esprima.Node

A reference to the scope-defining syntax node.
Type:
  • esprima.Node
Source:

childScopes :Scope[]

List of nested Scopes.
Type:
  • Scope[]
Source:

directCallToEvalScope :boolean

Whether this is a scope that contains an 'eval()' invocation.
Type:
  • boolean
Source:

dynamic :boolean

Generally, through the lexical scoping of JS you can always know which variable an identifier in the source code refers to. There are a few exceptions to this rule. With 'global' and 'with' scopes you can only decide at runtime which variable a reference refers to. Moreover, if 'eval()' is used in a scope, it might introduce new bindings in this or its prarent scopes. All those scopes are considered 'dynamic'.
Type:
  • boolean
Source:

functionExpressionScope :boolean

Whether this scope is created by a FunctionExpression.
Type:
  • boolean
Source:

isStrict :boolean

Whether 'use strict' is in effect in this scope.
Type:
  • boolean
Source:

references :Reference[]

Any variable reference found in this scope. This includes occurrences of local variables as well as variables from parent scopes (including the global scope). For local variables this also includes defining occurrences (like in a 'var' statement). In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list.
Type:
  • Reference[]
Source:

set :Map

The scoped Variables of this scope, as { Variable.name : Variable }.
Type:
  • Map
Source:

taints :Map

The tainted variables of this scope, as { Variable.name : boolean }.
Type:
  • Map
Source:

thisFound :boolean

Type:
  • boolean
Source:

through :Reference[]

The references that are not resolved with this scope.
Type:
  • Reference[]
Source:

type :String

One of 'catch', 'with', 'function', 'global' or 'block'.
Type:
  • String
Source:

upper :Scope

Reference to the parent scope.
Type:
Source:

variables :Variable[]

The scoped Variables of this scope. In the case of a 'function' scope this includes the automatic argument arguments as its first element, as well as all further formal arguments.
Type:
  • Variable[]
Source:

variableScope :Scope

For 'global' and 'function' scopes, this is a self-reference. For other scope types this is the variableScope value of the parent scope.
Type:
Source: