legacy-non-octal-escape-sequence-9-strict-explicit-pragma.js (865B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2020 Rick Waldron Inc. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-literals-string-literals 6 description: > 7 String Literals extensions disallowed in strict mode; NonOctalDecimalEscapeSequence 9 8 info: | 9 It is possible for string literals to precede a Use Strict Directive that places the enclosing 10 code in strict mode, and implementations must take care to not use this extended definition of 11 EscapeSequence with such literals. For example, attempting to parse the following source text 12 must fail. 13 14 Strict mode is entered via the explicit Use Strict Directive. 15 16 NonOctalDecimalEscapeSequence::one of 17 8 9 18 19 flags: [noStrict] 20 negative: 21 phase: parse 22 type: SyntaxError 23 ---*/ 24 25 $DONOTEVALUATE(); 26 27 function invalid() { "\9"; "use strict"; }