Ecma 262

Page 113

7. 8.

Set the [[FormalParameters]] internal property of F to an empty List. Set the [[Code]] internal property of F to be a FunctionBody that unconditionally throws a TypeError exception and performs no other action. 9. Call the [[DefineOwnProperty]] internal method of F with arguments "length", Property Descriptor {[[Value]]: 0, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false}, and false. 10. Set the [[Extensible]] internal property of F to false. 11. Let [[ThrowTypeError]] be F.

14 Program Syntax Program : SourceElementsopt SourceElements : SourceElement SourceElements SourceElement SourceElement : Statement FunctionDeclaration Semantics The production Program : SourceElementsopt is evaluated as follows: 1.

2. 3. 4. 5. 6.

The code of this Program is strict mode code if the Directive Prologue (14.1) of its SourceElements contains a Use Strict Directive or if any of the conditions of 10.1.1 apply. If the code of this Program is strict mode code, SourceElements is evaluated in the following steps as strict mode code. Otherwise SourceElements is evaluated in the following steps as non-strict mode code. If SourceElements is not present, return (normal, empty, empty). Let progCxt be a new execution context for global code as described in 10.4.1. Let result be the result of evaluating SourceElements. Exit the execution context progCxt. Return result.

NOTE The processes for initiating the evaluation of a Program and for dealing with the result of such an evaluation are defined by an ECMAScript implementation and not by this specification.

The production SourceElements : SourceElements SourceElement is evaluated as follows: 1. 2. 3. 4. 5.

Let headResult be the result of evaluating SourceElements. If headResult is an abrupt completion, return headResult. Let tailResult be result of evaluating SourceElement. If tailResult.value is empty, let V = headResult.value, otherwise let V = tailResult.value. Return (tailResult.type, V, tailResult.target)

The production SourceElement : Statement is evaluated as follows: 1.

Return the result of evaluating Statement.

The production SourceElement : FunctionDeclaration is evaluated as follows: 1.

Return (normal, empty, empty).

Š Ecma International 2011

101


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.