Closed Bug 1214048 Opened 4 years ago Closed 4 years ago

Error strings for calling functions with the spread operator is wrong when using iterators

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: shu, Assigned: shu)

References

Details

Attachments

(1 file, 1 obsolete file)

So, this:

var tests = ["foo"];
for (let check of tests)
  this[check.fn](...[1,2,3]);

prints out:

TypeError: tests[Symbol.iterator](...) is not a function

instead of this[check.fn] is not a function.

Somewhere in the stack manipulation of bytecode generated for iterators + spread is confusing the expression decompiler, probably.
Attachment #8673369 - Flags: review?(jorendorff)
Fixed typo in comment.
Attachment #8673369 - Attachment is obsolete: true
Attachment #8673369 - Flags: review?(jorendorff)
Attachment #8673373 - Flags: review?(jorendorff)
See Also: → 1216379
Comment on attachment 8673373 [details] [diff] [review]
Improve callee-not-a-function error for spread calls.

Review of attachment 8673373 [details] [diff] [review]:
-----------------------------------------------------------------

Enthusiastic r=me.
Attachment #8673373 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/a944e7136866
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Assignee: nobody → shu
You need to log in before you can comment on or make changes to this bug.