Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-init.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/annex-b-fns/eval-global-init.case
3 // - src/annex-b-fns/eval-global/direct-if-decl-else-stmt.template
4 /*---
5 description: Variable binding is initialized to `undefined` in outer scope (IfStatement with a declaration in the first statement position in eval code)
6 esid: sec-functiondeclarations-in-ifstatement-statement-clauses
7 es6id: B.3.4
8 flags: [generated, noStrict]
9 includes: [fnGlobalObject.js, propertyHelper.js]
10 info: |
11 The following rules for IfStatement augment those in 13.6:
12
13 IfStatement[Yield, Return]:
14 if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
15 if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
16 if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
17 if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
18
19
20 B.3.3.3 Changes to EvalDeclarationInstantiation
21
22 [...]
23 i. If varEnvRec is a global Environment Record, then
24 i. Perform ? varEnvRec.CreateGlobalFunctionBinding(F, undefined, true).
25 [...]
26
27 ---*/
28
29 eval(
30 'var global = fnGlobalObject();\
31 assert.sameValue(f, undefined, "binding is initialized to `undefined`");\
32 \
33 verifyProperty(global, "f", {\
34 enumerable: true,\
35 writable: true,\
36 configurable: true\
37 });if (true) function f() { } else ;'
38 );