Function code (Definition)

Script source in a declared function.

Availability:

ECMAScript edition - 2

Function code is the script source text that appears between the braces in a function declaration.

This could also fall under the heading of eval code if the function is being declared as a component within some script source text that has been passed to the eval() function for processing.

Function code initializes the scope chain to include its activation object followed by the global object.

Variable instantiation is performed using the activation object as the variable object and any initial variables are flagged with a DontDelete attribute.

The caller provides the this value but in some situations the value null may be passed. In that case, the global object will be used in its place.

See also:Compound statement, eval(), Executable code, Execution context, Function call, Function call operator ( ), function( ... ) ..., Script

Cross-references:

ECMA 262 edition 2 - section - 10.1.2

ECMA 262 edition 2 - section - 10.1.6

ECMA 262 edition 2 - section - 10.2.3

ECMA 262 edition 2 - section - 13

ECMA 262 edition 3 - section - 10.1.2

ECMA 262 edition 3 - section - 10.1.6

ECMA 262 edition 3 - section - 10.2.3

ECMA 262 edition 3 - section - 13