Skip to content

Commit

Permalink
Compile splats in arrays and function calls to ES2015 splats (#4353)
Browse files Browse the repository at this point in the history
Rather than compiling splats to arrays built using `Array#concat`, splats
are now compiled directly to ES2015 splats, e.g.

    f foo, arguments..., bar

    [ foo, arguments..., bar ]

Which used to be compiled to:

    f.apply(null, [foo].concat(slice.call(arguments), [bar]));

    [foo].concat(slice.call(arguments), [bar]);

Is now compiled to:

    f(foo, ...arguments, bar);

    [ foo, ...arguments, bar ];
  • Loading branch information
connec authored and GeoffreyBooth committed Nov 6, 2016
1 parent 496fd5d commit 663595b
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 203 deletions.
4 changes: 2 additions & 2 deletions lib/coffee-script/browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions lib/coffee-script/lexer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 663595b

Please sign in to comment.