-
Notifications
You must be signed in to change notification settings - Fork 12.8k
RegExpExecArray
should have explicit always-defined properties
#50520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Relevantish because @DetachHead sent #49682 |
RegExpExecArray
likely should be identical, have explicit always-defined properties
RegExpExecArray
likely should be identical, have explicit always-defined propertiesRegExpExecArray
should have explicit always-defined properties
Because people will come back to this issue, here's an example of where
|
In your code sample I believe the last line should be this:
Edit: This is wrong :-) |
@TomasHubelbauer No, he was right: |
Actually there shouldn’t be anything like |
i think the solution is to add the |
[L]ooking a little closely at the ECMAScript spec, I do think that there is a mismatch between what we have and what gets created in the runtime.
RegExpBuiltinExec
says that the following are created unconditionally:index
propertyinput
property0
groups
property that is always set, but may beundefined
So
RegExpExecArray
should look something kind of likeDerived from content posted by @DanielRosenwasser in #50211 (comment)
In additionl to the above, it seems like
RegExpMatchArray
/RegExpExecArray
are sometimes both returned from functions that undergo the same internal code paths. So we should probably ensure that one is compatible with the other, and have a test that ensures as much.The text was updated successfully, but these errors were encountered: