switch-dflt-global-existing-var-no-init.js (792B)
1 // This file was procedurally generated from the following sources: 2 // - src/annex-b-fns/global-existing-var-no-init.case 3 // - src/annex-b-fns/global/switch-dflt.template 4 /*--- 5 description: Existing variable binding is not modified (Funtion declaration in the `default` clause of a `switch` statement in the global scope) 6 esid: sec-web-compat-globaldeclarationinstantiation 7 flags: [generated, noStrict] 8 info: | 9 B.3.3.2 Changes to GlobalDeclarationInstantiation 10 11 [...] 12 b. If declaredFunctionOrVarNames does not contain F, then 13 i. Perform ? envRec.CreateGlobalFunctionBinding(F, undefined, false). 14 ii. Append F to declaredFunctionOrVarNames. 15 [...] 16 ---*/ 17 var f = 123; 18 assert.sameValue(f, 123); 19 20 switch (1) { 21 default: 22 function f() { } 23 } 24 25 reportCompare(0, 0);