mirror of
https://github.com/tc39/test262.git
synced 2025-05-04 06:50:32 +02:00
Test for Unicode Escape in Literals
This commit is contained in:
parent
8162f8c58f
commit
c1281dba45
20
test/language/literals/boolean/false-with-unicode.js
Normal file
20
test/language/literals/boolean/false-with-unicode.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2023 Veera Sivarajan. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-keywords-and-reserved-words
|
||||||
|
description: >
|
||||||
|
ReservedWord (false) cannot contain UnicodeEscapeSequence.
|
||||||
|
info: |
|
||||||
|
Note 1
|
||||||
|
|
||||||
|
Per 5.1.5, keywords in the grammar match literal sequences of specific SourceCharacter elements.
|
||||||
|
A code point in a keyword cannot be expressed by a \ UnicodeEscapeSequence.
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
f\u{61}lse;
|
20
test/language/literals/boolean/true-with-unicode.js
Normal file
20
test/language/literals/boolean/true-with-unicode.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2023 Veera Sivarajan. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-keywords-and-reserved-words
|
||||||
|
description: >
|
||||||
|
ReservedWord (true) cannot contain UnicodeEscapeSequence.
|
||||||
|
info: |
|
||||||
|
Note 1
|
||||||
|
|
||||||
|
Per 5.1.5, keywords in the grammar match literal sequences of specific SourceCharacter elements.
|
||||||
|
A code point in a keyword cannot be expressed by a \ UnicodeEscapeSequence.
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
tru\u{65};
|
20
test/language/literals/null/null-with-unicode.js
Normal file
20
test/language/literals/null/null-with-unicode.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2023 Veera Sivarajan. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-keywords-and-reserved-words
|
||||||
|
description: >
|
||||||
|
ReservedWord (null) cannot contain UnicodeEscapeSequence.
|
||||||
|
info: |
|
||||||
|
Note 1
|
||||||
|
|
||||||
|
Per 5.1.5, keywords in the grammar match literal sequences of specific SourceCharacter elements.
|
||||||
|
A code point in a keyword cannot be expressed by a \ UnicodeEscapeSequence.
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
n\u{75}ll;
|
Loading…
x
Reference in New Issue
Block a user