Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prefer-string-replace-all
: Don't crash on invalid pattern (#2011)
- Loading branch information
Showing
8 changed files
with
60 additions
and
6 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
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 |
---|---|---|
|
@@ -323,3 +323,11 @@ test({ | |
}, | ||
], | ||
}); | ||
|
||
test.snapshot({ | ||
valid: [], | ||
invalid: [ | ||
// Invalid RegExp | ||
'/(?!a)+/g', | ||
], | ||
}); |
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,19 @@ | ||
# Snapshot report for `test/better-regex.mjs` | ||
|
||
The actual snapshot is saved in `better-regex.mjs.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## Invalid #1 | ||
1 | /(?!a)+/g | ||
|
||
> Error 1/1 | ||
`␊ | ||
> 1 | /(?!a)+/g␊ | ||
| ^^^^^^^^^ Problem parsing /(?!a)+/g: ␊ | ||
␊ | ||
/(?!a)+/g␊ | ||
^␊ | ||
Unexpected token: "+" at 1:6.␊ | ||
` |
Binary file not shown.
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
Binary file not shown.