Closed Bug 1595049 Opened 8 months ago Closed 8 months ago

ForOfIterator doesn't call GetProperty with the correct receiver

Categories

(Core :: JavaScript Engine, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(2 files)

JS::ForOfIterator implements GetIterator, which uses GetMethod, which in turn uses GetV. That means ForOfIterator::init needs to use

GetProperty(cx, iterableObj, iterable, iteratorId, &callee)

instead of

GetProperty(cx, iterableObj, iterableObj, iteratorId, &callee)

So the receiver argument needs to be the original input and not the object-value.

Drive-by change, noticed while adding the test in part 1.

Depends on D52346

Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/284eaf863275
Part 1: Use the correct receiver value in ForOfIterator::init. r=arai
https://hg.mozilla.org/integration/autoland/rev/70bb6b11ccf6
Part 2: Enable some tests by default. r=arai
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.