Skip to content

Commit

Permalink
Test parsing error when using unicode escape sequences to express i, …
Browse files Browse the repository at this point in the history
…m, s

As suggested in #3960 (comment)
  • Loading branch information
ioannad authored and ptomato committed Mar 5, 2024
1 parent 229a27b commit 9e03c40
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
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 */;
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 */;
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 */;

0 comments on commit 9e03c40

Please sign in to comment.