Closed
Bug 1355558
Opened 7 years ago
Closed 7 years ago
Throw TypeError when calling RegExp flag and source getters with RegExp.prototype from different global
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(1 file)
9.16 KB,
patch
|
evilpie
:
review+
|
Details | Diff | Splinter Review |
Test case: --- var g = newGlobal(); var r = g.eval("RegExp.prototype"); Object.getOwnPropertyDescriptor(RegExp.prototype, "source").get.call(r); --- Expected: Throws TypeError Actual: No TypeError https://tc39.github.io/ecma262/#sec-get-regexp.prototype.source Step 3.a compares the this-value with the %RegExpPrototype% of the running execution context, so a wrapped RegExp.prototype object should throw per step 3.b.
Assignee | ||
Comment 1•7 years ago
|
||
I've also removed some trivial unnecessary rooting.
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Attachment #8857470 -
Flags: review?(evilpies)
Comment 2•7 years ago
|
||
This seems correct, but this is change might still cause regressions. Can you please push this to try?
Assignee | ||
Comment 3•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=27ea2f4a02ee4f94213b42c73a45a4a9db9c03a6
Assignee | ||
Comment 4•7 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #2) > This seems correct, but this is change might still cause regressions. Can > you please push this to try? Try looks good. Chrome is also throwing for cross-global RegExp.prototypes, so I hope this change is web-compatible. We'll see... :-)
Comment 5•7 years ago
|
||
Comment on attachment 8857470 [details] [diff] [review] bug1355558.patch Review of attachment 8857470 [details] [diff] [review]: ----------------------------------------------------------------- Okay, you are probably right.
Attachment #8857470 -
Flags: review?(evilpies) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9dd3f067044f Throw when calling RegExp.prototype getters with RegExp.prototype from different global. r=evilpie
Keywords: checkin-needed
Comment 7•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9dd3f067044f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•