Closed
Bug 1354529
Opened 8 years ago
Closed 8 years ago
Generator functions created through GeneratorFunction are incorrectly created as constructors
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.57 KB,
patch
|
arai
:
review+
|
Details | Diff | Splinter Review |
Derived from https://github.com/tc39/test262/blob/master/test/built-ins/GeneratorFunction/instance-construct-throws.js:
---
var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor;
var instance = GeneratorFunction();
new instance();
---
Expected: Throws TypeError
Actual: No TypeError
Assignee | ||
Comment 1•8 years ago
|
||
I don't think it matters whether async functions and async generators use INTERPRETED_LAMBDA_GENERATOR_OR_ASYNC or INTERPRETED_LAMBDA due to the wrapping. Is that correct?
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Attachment #8855779 -
Flags: review?(arai.unmht)
Comment 2•8 years ago
|
||
Comment on attachment 8855779 [details] [diff] [review]
bug1354529.patch
Review of attachment 8855779 [details] [diff] [review]:
-----------------------------------------------------------------
thanks!
(In reply to André Bargull from comment #1)
> I don't think it matters whether async functions and async generators use
> INTERPRETED_LAMBDA_GENERATOR_OR_ASYNC or INTERPRETED_LAMBDA due to the
> wrapping. Is that correct?
correct.
just to be sure, this is tested by the test262 (maybe added in the next update?), right?
Attachment #8855779 -
Flags: review?(arai.unmht) → review+
Assignee | ||
Comment 3•8 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #2)
> (In reply to André Bargull from comment #1)
> > I don't think it matters whether async functions and async generators use
> > INTERPRETED_LAMBDA_GENERATOR_OR_ASYNC or INTERPRETED_LAMBDA due to the
> > wrapping. Is that correct?
>
> correct.
Great!
>
> just to be sure, this is tested by the test262 (maybe added in the next
> update?), right?
Yes, this is tested by https://github.com/tc39/test262/blob/master/test/built-ins/GeneratorFunction/instance-construct-throws.js (which is not yet in our local test262 copy). I've verified this test fails without the patch, and passes when the patch is applied.
Assignee | ||
Comment 4•8 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f573b326c4edde1d35189ac4c76e7493be39a4ca
Keywords: checkin-needed
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/448b205d97fd
Don't set constructor-flag for generator functions created through GeneratorFunction intrinsic. r=arai
Keywords: checkin-needed
Comment 6•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•