block-decl-strict.js (569B)
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 description: AnnexB extension not honored in strict mode 5 es6id: B.3.3.2 6 info: | 7 Block statement in eval code containing a function declaration 8 9 B.3.3.3 Changes to EvalDeclarationInstantiation 10 11 1. If strict is false, then 12 ---*/ 13 14 var err; 15 16 (0,eval)('"use strict";{ function f() {} }'); 17 18 try { 19 f; 20 } catch (exception) { 21 err = exception; 22 } 23 24 assert.sameValue(err.constructor, ReferenceError); 25 26 reportCompare(0, 0);