1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00
serenity/Libraries/LibJS/Tests
Linus Groh 4fb96afafc LibJS: Support LegacyOctalEscapeSequence in string literals
https://tc39.es/ecma262/#sec-additional-syntax-string-literals

The syntax and semantics of 11.8.4 is extended as follows except that
this extension is not allowed for strict mode code:

Syntax

    EscapeSequence::
        CharacterEscapeSequence
        LegacyOctalEscapeSequence
        NonOctalDecimalEscapeSequence
        HexEscapeSequence
        UnicodeEscapeSequence

    LegacyOctalEscapeSequence::
        OctalDigit [lookahead ∉ OctalDigit]
        ZeroToThree OctalDigit [lookahead ∉ OctalDigit]
        FourToSeven OctalDigit
        ZeroToThree OctalDigit OctalDigit

    ZeroToThree :: one of
        0 1 2 3

    FourToSeven :: one of
        4 5 6 7

    NonOctalDecimalEscapeSequence :: one of
        8 9

This definition of EscapeSequence is not used in strict mode or when
parsing TemplateCharacter.

Note

It is possible for string literals to precede a Use Strict Directive
that places the enclosing code in strict mode, and implementations must
take care to not use this extended definition of EscapeSequence with
such literals. For example, attempting to parse the following source
text must fail:

function invalid() { "\7"; "use strict"; }
2020-10-24 16:34:01 +02:00
..
builtins LibJS: Don't change offset when reconfiguring property in unique shape 2020-10-10 23:25:00 +02:00
classes LibJS: Rest parameter in setter functions is a syntax error 2020-10-20 20:27:58 +02:00
functions LibJS: Don't parse arrow function with newline between ) and => 2020-10-19 11:31:55 +02:00
iterators Everywhere: Fix typos 2020-10-02 16:03:17 +02:00
loops LibJS: Check for exception after executing (do)while test expression 2020-10-23 19:06:57 +02:00
operators LibJS: Implement logical assignment operators (&&=, ||=, ??=) 2020-10-05 17:57:26 +02:00
add-values-to-primitive.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
automatic-semicolon-insertion.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
break-continue-syntax-errors.js LibJS: break or continue with nonexistent label is a syntax error 2020-10-08 23:27:16 +02:00
comments-basic.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
computed-property-throws.js LibJS: Check validity of computed_property_name() result before using it 2020-09-12 11:29:39 +02:00
const-reassignment.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
custom-@@hasInstance.js LibJS: Add Symbol.hasInstance tests 2020-07-14 20:15:19 +02:00
custom-@@toStringTag.js LibJS: Implement Symbol.toStringTag 2020-07-11 23:13:29 +02:00
debugger-statement.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
empty-statements.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
exception-in-catch-block.js LibJS: Check validity of computed_property_name() result before using it 2020-09-12 11:29:39 +02:00
exception-ReferenceError.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
exponentiation-basic.js Everywhere: Fix typos 2020-10-02 16:03:17 +02:00
indexed-access-string-object.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
invalid-lhs-in-assignment.js LibJS: Make assignment to CallExpression a syntax error in strict mode 2020-10-05 09:25:04 +02:00
labels.js LibJS: break or continue with nonexistent label is a syntax error 2020-10-08 23:27:16 +02:00
let-scoping.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
new-expression.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
numeric-literals-basic.js LibJS: Disallow NumericLiteral immediately followed by Identifier 2020-10-23 19:13:06 +02:00
object-basic.js LibJS: Rest parameter in setter functions is a syntax error 2020-10-20 20:27:58 +02:00
object-expression-computed-property.js LibJS: Fix PropertyName::from_value() for negative and non-int numbers 2020-10-08 10:02:47 +02:00
object-getter-setter-shorthand.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
object-method-shorthand.js LibJS: Add tests for symbol object integration 2020-07-09 23:33:00 +02:00
object-spread.js LibJS: Integrate iterator protocol into language features 2020-07-14 17:58:42 +02:00
parser-declaration-in-single-statement-context.js LibJS: Distinguish between statement and declaration 2020-10-23 19:13:06 +02:00
parser-line-terminators.js LibJS: Support all line terminators (LF, CR, LS, PS) 2020-10-22 10:06:30 +02:00
parser-unary-associativity.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
program-strict-mode.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
return.js LibJS: Fix return statements not working properly in loops 2020-10-08 23:23:55 +02:00
strict-mode-blocks.js LibJS: Strict mode is now handled by Functions and Programs, not Blocks 2020-10-04 10:46:12 +02:00
strict-mode-errors.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
string-escapes.js LibJS: Support LegacyOctalEscapeSequence in string literals 2020-10-24 16:34:01 +02:00
string-spread.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
switch-basic.js LibJS: Multiple 'default' clauses in switch statement are a syntax error 2020-10-19 11:30:14 +02:00
switch-break.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
tagged-template-literals.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
template-literals.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
test-common-tests.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
test-common.js LibJS: Simplify toEval() implementation 2020-09-18 20:49:35 +02:00
throw-basic.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
to-number-basic.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
to-number-exception.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
try-catch-finally-nested.js LibJS: Stop unwinding and reset exception for TryStatement finalizer 2020-09-12 09:31:16 +02:00
try-catch-finally.js LibJS: Allow try statement with only finally clause 2020-10-24 16:34:01 +02:00
update-expression-on-member-expression.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
update-expressions-basic.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
var-multiple-declarator.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
var-scoping.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
variable-undefined.js LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00