Skip to content

RegExp.prototype not an instance web compatibility workaround#511

Merged
bterlson merged 1 commit into
tc39:masterfrom
littledan:regexp-compat
Apr 7, 2016
Merged

RegExp.prototype not an instance web compatibility workaround#511
bterlson merged 1 commit into
tc39:masterfrom
littledan:regexp-compat

Conversation

@littledan

Copy link
Copy Markdown
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.
Comment thread spec.html
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

bterlson commented Apr 7, 2016

Copy link
Copy Markdown
Member

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