Opened on 09/16/2016 at 12:11:53 PM
Closed on 01/13/2017 at 10:09:29 AM
#4443 closed change (rejected)
Add support for the spread operator to jshydra
Reported by: | kzar | Assignee: | |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Automation | Keywords: | jshydra |
Cc: | sebastian, trev | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by trev)
Background
Since we already transpile a bunch of our JavaScript code, why not also add support for the spread operator?
What to change
Add support for the spread operator to jshydra. For example:
[1, ...[2, 3], 4]; | v [1].concat([2, 3]).concat([4]);
Math.max(...[1, 2]); | v Math.max.apply(Math.max, [1, 2]);
foo(1, ...[2, 3], 4); | v foo.apply(null, [1].concat([2, 3]).concat([4]));
Attachments (0)
Change History (3)
Note: See
TracTickets for help on using
tickets.
I've modified the examples to show how the code needs to be converted. The way I am setting the first parameter to apply() isn't entirely correct but should be good enough for us.