Skip to content

Commit 1a24186

Browse files
committed
Test parsing error when using unicode escape sequences to express i, m, s
As suggested in tc39#3960 (comment)
1 parent ff0a12a commit 1a24186

3 files changed

+57
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags)
6+
esid: sec-patterns-static-semantics-early-errors
7+
features: [regexp-modifiers]
8+
negative:
9+
phase: parse
10+
type: SyntaxError
11+
info: |
12+
Atom :: ( ? RegularExpresisonFlags : Disjunction )
13+
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.
14+
15+
---*/
16+
17+
$DONOTEVALUATE();
18+
19+
/(?\u0069:a)/u /* i */;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags)
6+
esid: sec-patterns-static-semantics-early-errors
7+
features: [regexp-modifiers]
8+
negative:
9+
phase: parse
10+
type: SyntaxError
11+
info: |
12+
Atom :: ( ? RegularExpresisonFlags : Disjunction )
13+
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.
14+
15+
---*/
16+
17+
$DONOTEVALUATE();
18+
19+
/(?\u006D:a)/u /* m */;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags)
6+
esid: sec-patterns-static-semantics-early-errors
7+
features: [regexp-modifiers]
8+
negative:
9+
phase: parse
10+
type: SyntaxError
11+
info: |
12+
Atom :: ( ? RegularExpresisonFlags : Disjunction )
13+
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.
14+
15+
---*/
16+
17+
$DONOTEVALUATE();
18+
19+
/(?\u0073:a)/u /* s */;

0 commit comments

Comments
 (0)