-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follow regexp validation as per tc39/ecma262#1869
- Loading branch information
1 parent
078e2cc
commit f1c3592
Showing
4 changed files
with
70 additions
and
35 deletions.
There are no files selected for viewing
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
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,10 @@ | ||
language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js (default) | ||
language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js (strict mode) | ||
language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js (default) | ||
language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js (strict mode) | ||
language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js (default) | ||
language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js (strict mode) | ||
language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js (default) | ||
language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js (strict mode) | ||
language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier-2.js (default) | ||
language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier-2.js (strict mode) |
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
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,21 @@ | ||
if (typeof exports != "undefined") { | ||
var test = require("./driver.js").test | ||
var testFail = require("./driver.js").testFail | ||
} | ||
|
||
// https://github.com/tc39/ecma262/pull/1869 | ||
testFail("/(?<\\ud835\\udc9c>.)/", "Invalid regular expression: /(?<\\ud835\\udc9c>.)/: Invalid capture group name (1:1)", { ecmaVersion: 2019 }) | ||
test("/(?<\\ud835\\udc9c>.)/", {}, { ecmaVersion: 2020 }) | ||
test("/(?<\\ud835\\udc9c>.)/u", {}, { ecmaVersion: 2019 }) | ||
test("/(?<\\ud835\\udc9c>.)/u", {}, { ecmaVersion: 2020 }) | ||
|
||
testFail("/(?<\\u{1d49c}>.)/", "Invalid regular expression: /(?<\\u{1d49c}>.)/: Invalid capture group name (1:1)", { ecmaVersion: 2019 }) | ||
test("/(?<\\u{1d49c}>.)/", {}, { ecmaVersion: 2020 }) | ||
test("/(?<\\u{1d49c}>.)/u", {}, { ecmaVersion: 2019 }) | ||
test("/(?<\\u{1d49c}>.)/u", {}, { ecmaVersion: 2020 }) | ||
|
||
testFail("/(?<π>.)/", "Invalid regular expression: /(?<π>.)/: Invalid capture group name (1:1)", { ecmaVersion: 2019 }) | ||
test("/(?<π>.)/", {}, { ecmaVersion: 2020 }) | ||
test("/(?<π>.)/u", {}, { ecmaVersion: 2019 }) | ||
test("/(?<π>.)/u", {}, { ecmaVersion: 2020 }) | ||
|