Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/annexB/language/eval-code/indirect/global-switch-case-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/indirect-switch-case.template
4 /*---
5 description: Variable binding is initialized to `undefined` in outer scope (Function declaration in the `case` clause of a `switch` statement in eval code)
6 esid: sec-web-compat-evaldeclarationinstantiation
7 es6id: B.3.3.3
8 flags: [generated, noStrict]
9 includes: [fnGlobalObject.js, propertyHelper.js]
10 info: |
11 B.3.3.3 Changes to EvalDeclarationInstantiation
12
13 [...]
14 i. If varEnvRec is a global Environment Record, then
15 i. Perform ? varEnvRec.CreateGlobalFunctionBinding(F, undefined, true).
16 [...]
17
18 ---*/
19
20 (0,eval)(
21 'var global = fnGlobalObject();\
22 assert.sameValue(f, undefined, "binding is initialized to `undefined`");\
23 \
24 verifyProperty(global, "f", {\
25 enumerable: true,\
26 writable: true,\
27 configurable: true\
28 });switch (1) {' +
29 ' case 1:' +
30 ' function f() { }' +
31 '}\
32 '
33 );