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

Projects
None yet
4 participants
@littledan
Member

littledan commented Apr 1, 2016

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.

RegExp.prototype not an instance web compatibility workaround
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.
@@ -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*.

This comment has been minimized.

@bterlson

bterlson Apr 7, 2016

Member

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

This comment has been minimized.

@annevk

annevk Apr 7, 2016

Contributor

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

This comment has been minimized.

@bterlson

bterlson Apr 7, 2016

Member

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

This comment has been minimized.

@mathiasbynens

mathiasbynens Apr 7, 2016

Member

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

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

@bterlson

This comment has been minimized.

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