Skip to content
Snippets Groups Projects
Unverified Commit e558b29b authored by Mathias Bynens's avatar Mathias Bynens
Browse files

Optimize character class escape tests

Previously, these tests simply compared against an equivalent regular expression pattern by generating a large string containing either all code points up to U+FFFF or U+10FFFF, depending on the `u` flag, and then performing:

    str.replace(re, '') === str.replace(otherRe, '');

These two `String#replace` calls can be optimized into a single `RegExp#test` call by following the pattern used in the property escapes tests at https://github.com/mathiasbynens/unicode-property-escapes-tests.
parent 01550ab1
No related branches found
No related tags found
No related merge requests found
Showing
with 272 additions and 160 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment