switch-dflt-decl-nostrict.js (667B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-web-compat-evaldeclarationinstantiation 5 description: > 6 AnnexB extension not honored in strict mode, Function declaration 7 in the `default` clause of a `switch` statement in eval code 8 info: | 9 B.3.3.3 Changes to EvalDeclarationInstantiation 10 11 1. If strict is false, then 12 ... 13 14 flags: [noStrict] 15 ---*/ 16 17 var err; 18 19 eval('\ 20 switch (1) {\ 21 default:\ 22 function f() { }\ 23 }\ 24 '); 25 26 try { 27 f; 28 } catch (exception) { 29 err = exception; 30 } 31 32 assert.sameValue(err, undefined); 33 34 reportCompare(0, 0);