-
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0540c1
commit 706167b
Showing
58 changed files
with
1,373 additions
and
26 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
31 changes: 6 additions & 25 deletions
31
tests/fixtures/ecma-version/6/regexUFlag/regex-u-invalid-extended-escape.result.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 |
---|---|---|
@@ -1,25 +1,6 @@ | ||
function uFlagSupported() { | ||
try { | ||
RegExp("", "u"); // eslint-disable-line no-invalid-regexp | ||
return true; | ||
} catch (err) { | ||
return false; | ||
} | ||
} | ||
|
||
// Acorn's parsing error is different depending on whether the environment supports the regex u flag. | ||
if (uFlagSupported()) { | ||
module.exports = { | ||
"index": 9, | ||
"lineNumber": 1, | ||
"column": 10, | ||
"message": "Error parsing regular expression: Invalid regular expression: /\\u{110000}/: Invalid unicode escape" | ||
}; | ||
} else { | ||
module.exports = { | ||
"index": 12, | ||
"lineNumber": 1, | ||
"column": 13, | ||
"message": "Code point out of bounds" | ||
}; | ||
} | ||
module.exports = { | ||
"index": 9, | ||
"lineNumber": 1, | ||
"column": 10, | ||
"message": "Invalid regular expression: /\\u{110000}/: Invalid unicode escape" | ||
}; |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/invalid-group.result.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,6 @@ | ||
module.exports = { | ||
"index": 1, | ||
"lineNumber": 1, | ||
"column": 2, | ||
"message": "Invalid regular expression: /(?<)/: Invalid capture group name" | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/invalid-group.src.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 @@ | ||
/(?<)/ |
6 changes: 6 additions & 0 deletions
6
.../fixtures/ecma-version/9/regexp-lookbehind-assertion/invalid-unterminated-group.result.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,6 @@ | ||
module.exports = { | ||
"index": 1, | ||
"lineNumber": 1, | ||
"column": 2, | ||
"message": "Invalid regular expression: /(?<=a/: Unterminated group" | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/invalid-unterminated-group.src.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 @@ | ||
/(?<=a/ |
84 changes: 84 additions & 0 deletions
84
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/valid-negative-1.result.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,84 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"expression": { | ||
"type": "Literal", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"value": null, | ||
"raw": "/(?<!a)/", | ||
"regex": { | ||
"pattern": "(?<!a)", | ||
"flags": "" | ||
} | ||
} | ||
} | ||
], | ||
"sourceType": "script", | ||
"tokens": [ | ||
{ | ||
"type": "RegularExpression", | ||
"value": "/(?<!a)/", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"regex": { | ||
"flags": "", | ||
"pattern": "(?<!a)" | ||
} | ||
} | ||
] | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/valid-negative-1.src.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 @@ | ||
/(?<!a)/ |
84 changes: 84 additions & 0 deletions
84
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/valid-negative-2.result.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,84 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
9 | ||
], | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
9 | ||
], | ||
"expression": { | ||
"type": "Literal", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
9 | ||
], | ||
"value": null, | ||
"raw": "/(?<!a)/u", | ||
"regex": { | ||
"pattern": "(?<!a)", | ||
"flags": "u" | ||
} | ||
} | ||
} | ||
], | ||
"sourceType": "script", | ||
"tokens": [ | ||
{ | ||
"type": "RegularExpression", | ||
"value": "/(?<!a)/u", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
9 | ||
], | ||
"regex": { | ||
"flags": "u", | ||
"pattern": "(?<!a)" | ||
} | ||
} | ||
] | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/valid-negative-2.src.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 @@ | ||
/(?<!a)/u |
84 changes: 84 additions & 0 deletions
84
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/valid-positive-1.result.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,84 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"expression": { | ||
"type": "Literal", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"value": null, | ||
"raw": "/(?<=a)/", | ||
"regex": { | ||
"pattern": "(?<=a)", | ||
"flags": "" | ||
} | ||
} | ||
} | ||
], | ||
"sourceType": "script", | ||
"tokens": [ | ||
{ | ||
"type": "RegularExpression", | ||
"value": "/(?<=a)/", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
8 | ||
], | ||
"regex": { | ||
"flags": "", | ||
"pattern": "(?<=a)" | ||
} | ||
} | ||
] | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/9/regexp-lookbehind-assertion/valid-positive-1.src.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 @@ | ||
/(?<=a)/ |
Oops, something went wrong.