1 // This file was procedurally generated from the following sources:
2 // - src/annex-b-fns/eval-func-block-scoping.case
3 // - src/annex-b-fns/eval-func/direct-switch-dflt.template
5 description: A block-scoped binding is created (Funtion declaration in the `default` clause of a `switch` statement in eval code in the global scope)
6 esid: sec-web-compat-evaldeclarationinstantiation
7 flags: [generated, noStrict]
9 13.2.14 Runtime Semantics: BlockDeclarationInstantiation
12 4. For each element d in declarations do
13 a. For each element dn of the BoundNames of d do
14 i. If IsConstantDeclaration of d is true, then
17 2. Perform ! envRec.CreateMutableBinding(dn, false).
19 b. If d is a GeneratorDeclaration production or a FunctionDeclaration
21 i. Let fn be the sole element of the BoundNames of d.
22 ii. Let fo be the result of performing InstantiateFunctionObject for
24 iii. Perform envRec.InitializeBinding(fn, fo).
26 var initialBV, currentBV, varBinding;
32 ' function f() { initialBV = f; f = 123; currentBV = f; return "decl"; }' +
43 'Block-scoped binding value is function object at execution time'
45 assert.sameValue(currentBV, 123, 'Block-scoped binding is mutable');
49 'Block-scoped binding is independent of outer var-scoped binding'