Skip to content
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

RegExp.prototype not an instance web compatibility workaround #511

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

littledan
Copy link
Member

This patch makes a change to ES2015 RegExp semantics to prevent
certain property accesses and method calls from throwing. Although
the feature testing patterns here are dispreferred, they were found
necessary to ensure web compatibility of ES2015-based RegExp
semantics with respect to old versions of certain libraries.

This closes #262.

This patch attempts to encode the consensus of the March 2016 TC39 meeting.

This patch makes a change to ES2015 RegExp semantics to prevent
certain property accesses and method calls from throwing. Although
the feature testing patterns here are dispreferred, they were found
necessary to ensure web compatibility of ES2015-based RegExp
semantics with respect to old versions of certain libraries.

This closes tc39#262.
@@ -28965,7 +28965,9 @@
<emu-alg>
1. Let _R_ be the *this* value.
1. If Type(_R_) is not Object, throw a *TypeError* exception.
1. If _R_ does not have an [[OriginalFlags]] internal slot, throw a *TypeError* exception.
1. If _R_ does not have an [[OriginalFlags]] internal slot,
1. If SameValue(_R_, %RegExpPrototype%), return *undefined*.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If SameValue... is true, I think :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, "then return undefined" is probably more consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined is correct I think (tho maybe I am missing what you were saying)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @annevk meant to say “then” is missing.

@bterlson bterlson merged commit 1a2ca97 into tc39:master Apr 7, 2016
@bterlson
Copy link
Member

bterlson commented Apr 7, 2016

Whoops, didn't mean to go through with the merge (was just testing the new setting). I will fix up the style issues I noted now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature testing no longer possible with RegExp.prototype.sticky
4 participants