1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
Commit graph

10 commits

Author SHA1 Message Date
Geoffrey Booth
294bb4754e
Fix #5112: A string of ', ' in an array should not be detected as an elision (#5113) 2018-10-05 06:45:54 -07:00
zdenko
b1286752b9 improve elision output (#4824) 2017-12-10 15:22:34 -08:00
zdenko
f14c7ffa3f Fixes #4684: Elision (#4796)
* Elision

* test

* improvements

* grammar optimization

* cleanup
2017-11-28 21:24:18 -08:00
zdenko
5713b7eb6c [CS2] Fix #4260 and #1349: Splat error with soak properties or expressions (#4644)
* fix splat error with soak properties or expressions

* Add test based on #4260

* Add test based on #1349

* tests for the leading splat variant

* test for spaced prefix ...

* fixed 'if' statement in parens

* fixed replacing 'void 0' with '[]'

* remove 'void 0' replacement; add Splat::compileNode

* Use LEVEL_OP; follow style better
2017-08-27 15:11:14 -07:00
Geoffrey Booth
9524159e68 Merge branch 'master' into 2
# Conflicts:
#	lib/coffee-script/lexer.js
#	lib/coffee-script/nodes.js
#	lib/coffee-script/optparse.js
#	lib/coffee-script/rewriter.js
#	lib/coffee-script/scope.js
#	lib/coffee-script/sourcemap.js
#	src/nodes.coffee
#	test/classes.coffee
#	test/comments.coffee
#	test/error_messages.coffee
2016-11-10 22:51:39 -08:00
Geoffrey Booth
b3896d08e8 Add a for .. from .. loop for generators, see #4306, #3832 (#4355)
* Added support for for-from loop, see #3832

* for-from: remove extra newline and add support for ranges

* for-from: tidy up the lexer

* for-from: add support for patterns

* for-from: fix bad alignment

* for-from: add two more tests

* for-from: fix test "for-from loops over generators"

See explanation here: https://github.com/jashkenas/coffeescript/pull/4306#issuecomment-257066877

* for-from: delete leftover console.log

* Refactor the big `if` block in the lexer to be as minimal a change from `master` as we can get away with

* Cleanup to make more idiomatic, remove trailing whitespace, minor performance improvements

* for-from: move code from one file to another

* for-from: clean up whitespace

* for-from: lexer bikeshedding

* Move "own is not supported in for-from loops" test into error_messages.coffee; improve error message so that "own" is underlined

* Revert unnecessary changes, to minimize the lines of code modified by this PR
2016-11-07 23:40:01 -08:00
Chris Connelly
663595ba94 Compile splats in arrays and function calls to ES2015 splats (#4353)
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 ];
2016-11-06 08:30:04 -08:00
Simon Lydell
3db029f2c1 Make regexes always uncallable
No matter if they have interpolations or not.
2015-01-15 19:44:14 +01:00
Simon Lydell
fce502ac98 Fix #3194: Make strings always uncallable
No matter if they have interpolations or not.
2015-01-14 21:27:24 +01:00
Jeremy Ashkenas
19849e66d4 renaming wordy test titles. 2011-04-23 13:35:15 -04:00
Renamed from test/array_literals.coffee (Browse further)