Global code (Definition)

Script source that is outside of any function code blocks.

Availability:

ECMAScript edition - 2

Global code is that source text that is outside of all function declarations.

On initialization of some global code into an execution context, the scope chain is initialized to only contain the global object and nothing else.

Variable instantiation is performed using the global object as the variable object and with empty property attributes.

The this value is set to point at the global object.

See also:Executable code, Execution context, function( ... ) ..., Script

Cross-references:

ECMA 262 edition 2 - section - 10.1.2

ECMA 262 edition 2 - section - 10.2.1

ECMA 262 edition 3 - section - 10.1.2

ECMA 262 edition 3 - section - 10.2.1