1 // This file was procedurally generated from the following sources:
2 // - src/annex-b-fns/eval-func-init.case
3 // - src/annex-b-fns/eval-func/direct-switch-case.template
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 flags: [generated, noStrict]
9 B.3.3.3 Changes to EvalDeclarationInstantiation
12 a. If declaredFunctionOrVarNames does not contain F, then
13 i. If varEnvRec is a global Environment Record, then
16 i. Let bindingExists be varEnvRec.HasBinding(F).
17 ii. If bindingExists is false, then
18 i. Perform ! varEnvRec.CreateMutableBinding(F, true).
19 ii. Perform ! varEnvRec.InitializeBinding(F, undefined).
28 changed = f;switch (1) {' +
36 assert.sameValue(init, undefined, 'binding is initialized to `undefined`');
37 assert.sameValue(changed, 123, 'binding is mutable');
38 assert.throws(ReferenceError, function() {
40 }, 'global binding is not created');