Debian Codegraph @

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