enable-strict-via-body.js (664B)
1 // |reftest| error:SyntaxError 2 // Copyright (c) 2012 Ecma International. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 info: | 7 Refer 13; 8 The production FunctionBody : SourceElementsopt is evaluated as follows: 9 es5id: 13.0-10-s 10 description: > 11 Strict Mode - SourceElements is evaluated as strict mode code when 12 the code of this FunctionBody with an inner function contains a 13 Use Strict Directive 14 negative: 15 phase: parse 16 type: SyntaxError 17 flags: [noStrict] 18 ---*/ 19 20 $DONOTEVALUATE(); 21 22 function _13_0_10_fun() { 23 function _13_0_10_inner() { 24 "use strict"; 25 eval = 42; 26 } 27 }