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