Closed
Bug 1318017
Opened 8 years ago
Closed 8 years ago
Call GetPrototypeFromConstructor for generator/async function and Intl constructors
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(1 file, 2 obsolete files)
37.57 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
GetPrototypeFromConstructor needs to be called to ensure subclassing works as expected.
Assignee | ||
Comment 1•8 years ago
|
||
I've added you as the reviewer because this patch and bug 755821 touch the same code in jsfun.cpp, and it also affects the new async function code.
Attachment #8811367 -
Flags: review?(arai.unmht)
Comment 2•8 years ago
|
||
Comment on attachment 8811367 [details] [diff] [review] bug1318017.patch Review of attachment 8811367 [details] [diff] [review]: ----------------------------------------------------------------- Thanks. It would be nice to check subclassed AsyncFunction and GeneratorFunction really works when it's called. maybe in separated patch. ::: js/src/builtin/Intl.cpp @@ +807,2 @@ > if (construct) { > + // Step 2 (Inlined 9.1.14, OrdinaryCreateFromConstructor). Step 5. @@ +826,4 @@ > RootedValue locales(cx, args.length() > 0 ? args[0] : UndefinedValue()); > RootedValue options(cx, args.length() > 1 ? args[1] : UndefinedValue()); > > + // Step 3. Step 6. ::: js/src/jsfun.cpp @@ +1735,2 @@ > RootedObject proto(cx); > + if (!isAsync && !GetPrototypeFromCallableConstructor(cx, args, &proto)) Separating `if (...)` for each might be clearer, since the meaning of `false` differs for each. if (!isAsync) { if (!GetPrototypeFromCallableConstructor(cx, args, &proto)) return false; } it's up to you tho. ::: js/src/tests/Intl/Collator/construct-newtarget.js @@ +29,5 @@ > + > +// Set a different constructor as NewTarget. > +obj = Reflect.construct(MyCollator, [], Array); > +assertEq(obj instanceof MyCollator, false); > +assertEq(obj instanceof Intl.Collator, false); would be nice to check assertEq(obj instanceof Array, true); same for others.
Attachment #8811367 -
Flags: review?(arai.unmht) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Updated patch per review comments. Carrying r+ from Arai. Also fixed a bug from the previous patch: I was calling CallArgs::callee() after CallArgs::rval() was used, which is not allowed. There was no assertion error ("Assertion failure: !usedRval_") because two separate CallArgs instances were created. I've changed the FunctionConstructor method to use `const CallArgs&` to catch this kind of error.
Attachment #8811367 -
Attachment is obsolete: true
Attachment #8811870 -
Flags: review+
Assignee | ||
Comment 4•8 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e6e9025a3d296b4c267b07c7eeb4711493a7ca45
Keywords: checkin-needed
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/4e8c181309b1 Call GetPrototypeFromConstructor for generator, async function, and Intl constructors. r=arai
Keywords: checkin-needed
Comment 6•8 years ago
|
||
had to back this out for failures like https://treeherder.mozilla.org/logviewer.html#?job_id=39434628&repo=mozilla-inbound
Flags: needinfo?(andrebargull)
Backout by cbook@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/95e326672620 Backed out changeset 4e8c181309b1 for j1 test failures
Assignee | ||
Comment 8•8 years ago
|
||
Argh, I forgot to add the has-Intl guard in the reftest line.
Flags: needinfo?(andrebargull)
Comment 9•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4e8c181309b1
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Assignee | ||
Comment 10•8 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #9) > https://hg.mozilla.org/mozilla-central/rev/4e8c181309b1 Now I'm a bit confused, I thought the change was (rightfully) backed out from inbound?
Flags: needinfo?(cbook)
Comment 12•8 years ago
|
||
The way we do things, including filing an intermittent-failure bug for a failure that isn't intermittent and then three minutes later backing out the cause and then three hours later merging something from between the bustage and the backout to mozilla-central, will become much clearer to you if you buy a pair of shoes from http://www.spearshoes.com/ and walk around in them for a while.
Status: RESOLVED → REOPENED
Flags: needinfo?(cbook)
Resolution: FIXED → ---
Comment 13•8 years ago
|
||
Merge of backout: https://hg.mozilla.org/mozilla-central/rev/95e326672620
status-firefox53:
fixed → ---
Target Milestone: mozilla53 → ---
Assignee | ||
Comment 14•8 years ago
|
||
Updated patch to include Intl guard, carrying r+ from Arai.
Attachment #8811870 -
Attachment is obsolete: true
Attachment #8812758 -
Flags: review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 15•8 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/e48faa1e4783 Call GetPrototypeFromConstructor for generator, async function, and Intl constructors. r=arai
Keywords: checkin-needed
Comment 16•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e48faa1e4783
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•