| "Test numeric escapes in string literals - https://bugs.webkit.org/show_bug.cgi?id=51724" |
| function test(_stringLiteral, _nonStrictResult, _strictResult) |
| stringLiteral = '"' + _stringLiteral + '"'; |
| nonStrictResult = _nonStrictResult; |
| shouldBe("eval(stringLiteral)", "nonStrictResult"); |
| stringLiteral = '"use strict"; ' + stringLiteral; |
| strictResult = _strictResult; |
| shouldBe("eval(stringLiteral)", "strictResult"); |
| shouldThrow("eval(stringLiteral)"); |
| // Tests for single digit octal and decimal escapes. |
| // In non-strict mode 0-7 are octal escapes, 8-9 are NonEscapeCharacters. |
| // In strict mode only "\0" is permitted. |
| test("\\0", "\x00", "\x00"); |
| // Tests for multi-digit octal values outside strict mode; |
| // Octal literals may be 1-3 digits long. In strict more all multi-digit sequences are illegal. |