forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds syntax tests for the RegExp modifiers proposal
Based on PR tc39#3807 which had generated these tests from templates, but was stuck due to issue tc39#3808. Co-Authored-By: Guillaume Emont <[email protected]> Co-Authored-By: Ioanna M. Dimitriou H <[email protected]>
- Loading branch information
Showing
151 changed files
with
2,539 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-1.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?ii:a)", ""); | ||
}, 'RegExp("(?ii:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-2.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?imsi:a)", ""); | ||
}, 'RegExp("(?imsi:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-arbitrary.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?1:a)", ""); | ||
}, 'RegExp("(?1:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-combining-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?iͥ:a)", ""); | ||
}, 'RegExp("(?iͥ:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-combining-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?mͫ:a)", ""); | ||
}, 'RegExp("(?mͫ:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-combining-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?s̀:a)", ""); | ||
}, 'RegExp("(?s̀:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-d.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?d:a)", ""); | ||
}, 'RegExp("(?d:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-g.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?g:a)", ""); | ||
}, 'RegExp("(?g:a)", ""): '); |
Binary file added
BIN
+778 Bytes
test/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-1.js
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-2.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?s:a)", ""); | ||
}, 'RegExp("(?s:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-non-flag.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?Q:a)", ""); | ||
}, 'RegExp("(?Q:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-u.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?u:a)", ""); | ||
}, 'RegExp("(?u:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-y.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?y:a)", ""); | ||
}, 'RegExp("(?y:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-zwj.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?s:a)", ""); | ||
}, 'RegExp("(?s:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-zwnbsp.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?s:a)", ""); | ||
}, 'RegExp("(?s:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-other-code-point-zwnj.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?s:a)", ""); | ||
}, 'RegExp("(?s:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-should-not-case-fold-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?I:a)", "i"); | ||
}, 'RegExp("(?I:a)", "i"): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-should-not-case-fold-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?M:a)", "i"); | ||
}, 'RegExp("(?M:a)", "i"): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-should-not-case-fold-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?S:a)", "i"); | ||
}, 'RegExp("(?S:a)", "i"): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?İ:a)", "iu"); | ||
}, 'RegExp("(?İ:a)", "iu"): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
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. | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?ſ:a)", "u"); | ||
}, 'RegExp("(?ſ:a)", "u"): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
info: | | ||
Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) | ||
... | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?i-i:a)", ""); | ||
}, 'RegExp("(?i-i:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
info: | | ||
Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) | ||
... | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?m-m:a)", ""); | ||
}, 'RegExp("(?m-m:a)", ""): '); |
16 changes: 16 additions & 0 deletions
16
test/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-multi-duplicate.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,16 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) | ||
esid: sec-patterns-static-semantics-early-errors | ||
features: [regexp-modifiers] | ||
info: | | ||
Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) | ||
... | ||
---*/ | ||
|
||
assert.throws(SyntaxError, function () { | ||
RegExp("(?ims-m:a)", ""); | ||
}, 'RegExp("(?ims-m:a)", ""): '); |
Oops, something went wrong.