You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
Directly testing for @@matchAll avoids the extra IsRegExp call which can produce side-effects. And it also matches the calling pattern in all other String.prototype methods which take a RegExp argument.
For the non-RegExp case: Calling RegExpCreate to create a new RegExp object and then calling MatchAllIterator to create just another new RegExp seems wasteful and makes it harder to optimize this function for implementors.
Similar to the case from above, avoiding the extra IsRegExp call makes it easier to optimize this case, because we don't have to worry about potential side-effects.