Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usage of the u flag with regular expressions is recommended.
The u flag has two effects:
It enables correct handling of UTF-16 surrogate pairs.
It ensures the correct behavior of regex character ranges.
Make the regular expression throwing syntax errors early as disabling JavaScript specification Annex B[1] extensions.
Because of historical reason, JavaScript regular expressions are tolerant of syntax errors. For example, /\w{1, 2/ is a syntax error, but JavaScript doesn't throw the error. It matches strings such as "a{1, 2" instead. Such a recovering logic is defined in Annex B of Javascript specification.
The u flag disables the recovering logic Annex B of the Javascript specification. As a result, you can find errors early. This is similar to the strict mode.