Opened 3 years ago

Closed 3 years ago

#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]));

Change History (3)

comment:1 Changed 3 years ago by sebastian

  • Priority changed from Unknown to P3
  • Ready set

comment:2 Changed 3 years ago by trev

  • Description modified (diff)

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.

comment:3 Changed 3 years ago by sebastian

  • Resolution set to rejected
  • Status changed from new to closed

jsHydra is no longer maintained, as we don't transpile the code anymore.

Note: See TracTickets for help on using tickets.