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

RESOLVED FIXED in Firefox 44

Status

()

Core
JavaScript Engine
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: shu, Assigned: shu)

Tracking

unspecified
mozilla44
Points:
---

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
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.
(Assignee)

Comment 1

2 years ago
Created attachment 8673369 [details] [diff] [review]
Improve callee-not-a-function error for spread calls.
Attachment #8673369 - Flags: review?(jorendorff)
(Assignee)

Comment 2

2 years ago
Created attachment 8673373 [details] [diff] [review]
Improve callee-not-a-function error for spread calls.

Fixed typo in comment.
Attachment #8673369 - Attachment is obsolete: true
Attachment #8673369 - Flags: review?(jorendorff)
Attachment #8673373 - Flags: review?(jorendorff)

Updated

2 years ago
See Also: → bug 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
Last Resolved: 2 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Assignee: nobody → shu
You need to log in before you can comment on or make changes to this bug.