-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test parsing error when using unicode escape sequences to express i, …
…m, s As suggested in #3960 (comment)
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
test/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-i.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
negative: | ||
phase: parse | ||
type: SyntaxError | ||
info: | | ||
Atom :: ( ? RegularExpresisonFlags : Disjunction ) | ||
It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. | ||
---*/ | ||
|
||
$DONOTEVALUATE(); | ||
|
||
/(?\u0069:a)/u /* i */; |
19 changes: 19 additions & 0 deletions
19
test/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-m.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
negative: | ||
phase: parse | ||
type: SyntaxError | ||
info: | | ||
Atom :: ( ? RegularExpresisonFlags : Disjunction ) | ||
It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. | ||
---*/ | ||
|
||
$DONOTEVALUATE(); | ||
|
||
/(?\u006D:a)/u /* m */; |
19 changes: 19 additions & 0 deletions
19
test/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-s.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
negative: | ||
phase: parse | ||
type: SyntaxError | ||
info: | | ||
Atom :: ( ? RegularExpresisonFlags : Disjunction ) | ||
It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. | ||
---*/ | ||
|
||
$DONOTEVALUATE(); | ||
|
||
/(?\u0073:a)/u /* s */; |