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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 19 additions & 7 deletions spec.html
Expand Up @@ -28965,7 +28965,9 @@ <h1>get RegExp.prototype.global</h1>
<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.

1. Otherwise, throw a *TypeError* exception.
1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
1. If _flags_ contains the code unit `"g"`, return *true*.
1. Return *false*.
Expand All @@ -28979,7 +28981,9 @@ <h1>get RegExp.prototype.ignoreCase</h1>
<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*.
1. Otherwise, throw a *TypeError* exception.
1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
1. If _flags_ contains the code unit `"i"`, return *true*.
1. Return *false*.
Expand Down Expand Up @@ -29030,7 +29034,9 @@ <h1>get RegExp.prototype.multiline</h1>
<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*.
1. Otherwise, throw a *TypeError* exception.
1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
1. If _flags_ contains the code unit `"m"`, return *true*.
1. Return *false*.
Expand Down Expand Up @@ -29130,8 +29136,10 @@ <h1>get RegExp.prototype.source</h1>
<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 [[OriginalSource]] internal slot, 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 [[OriginalSource]] internal slot,
1. If SameValue(_R_, %RegExpPrototype%), return `"(?:)"`.
1. Otherwise, throw a *TypeError* exception.
1. Assert: _R_ has an [[OriginalFlags]] internal slot.
1. Let _src_ be the value of _R_'s [[OriginalSource]] internal slot.
1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
1. Return EscapeRegExpPattern(_src_, _flags_).
Expand Down Expand Up @@ -29216,7 +29224,9 @@ <h1>get RegExp.prototype.sticky</h1>
<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*.
1. Otherwise, throw a *TypeError* exception.
1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
1. If _flags_ contains the code unit `"y"`, return *true*.
1. Return *false*.
Expand Down Expand Up @@ -29259,7 +29269,9 @@ <h1>get RegExp.prototype.unicode</h1>
<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*.
1. Otherwise, throw a *TypeError* exception.
1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
1. If _flags_ contains the code unit `"u"`, return *true*.
1. Return *false*.
Expand Down