Debian Codegraph @

js/src/tests/test262/language/literals/string/legacy-non-octal-escape-sequence-5-strict-explicit-pragma.js

raw
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; FourToSeven 5
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 FourToSeven::one of
17 4 5 6 7
18
19 flags: [noStrict]
20 negative:
21 phase: parse
22 type: SyntaxError
23 ---*/
24
25 $DONOTEVALUATE();
26
27 function invalid() { "\5"; "use strict"; }