| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/annex-b-fns/global-init.case |
| 3 |
// - src/annex-b-fns/global/switch-dflt.template |
| 4 |
/*--- |
| 5 |
description: Variable binding is initialized to `undefined` in outer scope (Funtion declaration in the `default` clause of a `switch` statement in the global scope) |
| 6 |
esid: sec-web-compat-globaldeclarationinstantiation |
| 7 |
es6id: B.3.3.2 |
| 8 |
flags: [generated, noStrict] |
| 9 |
includes: [fnGlobalObject.js, propertyHelper.js] |
| 10 |
info: | |
| 11 |
B.3.3.2 Changes to GlobalDeclarationInstantiation |
| 12 |
|
| 13 |
[...] |
| 14 |
b. If declaredFunctionOrVarNames does not contain F, then |
| 15 |
i. Perform ? envRec.CreateGlobalFunctionBinding(F, undefined, false). |
| 16 |
ii. Append F to declaredFunctionOrVarNames. |
| 17 |
[...] |
| 18 |
|
| 19 |
---*/ |
| 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: false |
| 27 |
}); |
| 28 |
|
| 29 |
switch (1) { |
| 30 |
default: |
| 31 |
function f() { } |
| 32 |
} |