Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Commits on Nov 15, 2013
@alubbe alubbe removed 'yield' from the reserved keywords f51cbd7
@alubbe alubbe added 'yield' to the unary keywords dafc7bd
@alubbe alubbe using 'yield' automatically turns functions into generators 9941050
Commits on Nov 30, 2013
@alubbe alubbe added a test for generators f11ca98
@alubbe alubbe removed yield from the reserved words 7906a2b
@alubbe alubbe npm run-script test-harmony executes generator tests d712a6c
@alubbe alubbe improved readability of generator test 74a92db
@alubbe alubbe entire generator test file is now ignored if generators are not avail…
…able
9d29a83
Commits on Dec 01, 2013
@alubbe alubbe improved readability of cakefile generator check 85c7fff
Commits on Dec 03, 2013
@alubbe alubbe further improved readability of cakefile generator check f4b850d
Commits on Dec 05, 2013
@alubbe alubbe fixed misspelling in Cakefile c02a403
@alubbe alubbe Merge github.com:jashkenas/coffee-script e100020
Commits on Dec 19, 2013
@alubbe alubbe first attempt at using '->*" and '=>*' for generators 56b04a5
Commits on Dec 20, 2013
@alubbe alubbe '->*' and '=>*' now produce generators dab4ae9
Commits on Dec 24, 2013
@alubbe alubbe first attempt at including 'yield*' 25b1eee
Commits on Dec 26, 2013
@alubbe alubbe updated lexer to allow 'yield*' 64e78a2
Commits on Dec 28, 2013
@alubbe alubbe 'yield*' now works as expected 1e377ed
Commits on Jan 26, 2014
@alubbe alubbe Merge https://github.com/jashkenas/coffee-script
Conflicts:
	lib/coffee-script/lexer.js
	lib/coffee-script/parser.js
	lib/coffee-script/rewriter.js
	src/lexer.coffee
	src/rewriter.coffee
f375394
Commits on May 08, 2014
@jashkenas merged 6ae21ae
Commits on Jun 23, 2014
@gscottolson gscottolson Retina favicon.ico ba4157b
Commits on Jun 26, 2014
@vendethiel vendethiel Update link to "CoffeeScript Ristretto", fixes #3489 1157b32
Commits on Jul 23, 2014
@vendethiel vendethiel Fix the "Examples" link on coffeescript.org
It now points to the "Trending repositories" of the month.
e8c96de
Commits on Aug 26, 2014
@jashkenas merged 53aa50f
Commits on Aug 27, 2014
@epmatsw epmatsw Quick spelling fixes 94c467b
@michaelficarra michaelficarra Merge pull request #3616 from epmatsw/spelling
Quick spelling fixes
8b066f1
Commits on Aug 28, 2014
@josh josh Remove josh/nack from Examples 872092f
@josh josh Add Atom to Examples 9dfd71b
@michaelficarra michaelficarra Merge pull request #3618 from josh/update-site-example-projects
Refresh site Examples section
b407a59
Commits on Sep 06, 2014
@alubbe alubbe Merge remote-tracking branch 'A/master' 7590066
@alubbe alubbe removed support for '->*" and '=>*' 565d78f
@alubbe alubbe added 'yield from' c725566
@alubbe alubbe added 'yield return' 437b9ed
@alubbe alubbe always wrap 'yield' in () to allow composability with all other opera…
…tors
781ea22
@alubbe alubbe added tests for yield, yield from, yield return and yield in if state…
…ments
efca286
Commits on Sep 17, 2014
@lbeschastny lbeschastny Fixed jashkenas/coffeescript#3638 - invalid block comments compilation 55e3b6b
@lbeschastny lbeschastny Added test for jashkenas/coffeescript#3638 77d5b95
Commits on Sep 19, 2014
@jashkenas Merge pull request #3240 from alubbe/master
using 'yield' automatically turns functions into generators
a78cbe7
Commits on Sep 23, 2014
@jashkenas Merge pull request #3638 from lbeschastny/issue3638
Invalid block comments compilation
158ca0d
Commits on Oct 12, 2014
@Artazor Artazor Added failing test case for the `yield` precedence e8a4e93
@Artazor Artazor Improved test readability + fixed integer divison ec44aba
Commits on Oct 13, 2014
@alubbe alubbe implemented proper precedence for 'yield' dd5da7f
@jashkenas Merge pull request #3677 from alubbe/master
implemented proper precedence for 'yield'
4f82e59
Commits on Oct 27, 2014
@jashkenas Merge pull request #3521 from gscottolson/master
Retina favicon.ico
f2a3f75
Commits on Oct 29, 2014
@bigtunacan bigtunacan Added an initial bower.json configuration file 2c6e6ca
@bigtunacan bigtunacan Removed "mkdirp": "~0.3.5" from bower.json 4035e7c
@jashkenas Merge pull request #3703 from bigtunacan/master
Add bower.json configuration
a563e8f
Commits on Nov 17, 2014
@jashkenas add Die Alternative to books section 485aa8e
Commits on Nov 21, 2014
@alubbe alubbe fixed yield keyword not working in switch & for loop expressions a9fbf14
@alubbe alubbe added tests for yield in switch & for loop expressions 5950d63
@jashkenas Merge pull request #3734 from alubbe/master
fixed yield keyword not working in switch & for loop expressions
4199f4f
Commits on Dec 03, 2014
@sscotth sscotth include logo .svg files 931b74e
@jashkenas Merge pull request #3748 from sscotth/master
Include logo .svg files
8e4fb1b
Commits on Jan 04, 2015
@lydell lydell Refactor interpolation (and string and regex) handling in lexer
- Fix #3394: Unclosed single-quoted strings (both regular ones and heredocs)
  used to pass through the lexer, causing a parsing error later, while
  double-quoted strings caused an error already in the lexing phase. Now both
  single and double-quoted unclosed strings error out in the lexer (which is the
  more logical option) with consistent error messages. This also fixes the last
  comment by @satyr in #3301.

- Similar to the above, unclosed heregexes also used to pass through the lexer
  and not error until in the parsing phase, which resulted in confusing error
  messages. This has been fixed, too.

- Fix #3348, by adding passing tests.

- Fix #3529: If a string starts with an interpolation, an empty string is no
  longer emitted before the interpolation (unless it is needed to coerce the
  interpolation into a string).

- Block comments cannot contain `*/`. Now the error message also shows exactly
  where the offending `*/`. This improvement might seem unrelated, but I had to
  touch that code anyway to refactor string and regex related code, and the
  change was very trivial. Moreover, it's consistent with the next two points.

- Regexes cannot start with `*`. Now the error message also shows exactly where
  the offending `*` is. (It might actually not be exatly at the start in
  heregexes.) It is a very minor improvement, but it was trivial to add.

- Octal escapes in strings are forbidden in CoffeeScript (just like in
  JavaScript strict mode). However, this used to be the case only for regular
  strings. Now they are also forbidden in heredocs. Moreover, the errors now
  point at the offending octal escape.

- Invalid regex flags are no longer allowed. This includes repeated modifiers
  and unknown ones. Moreover, invalid modifiers do not stop a heregex from
  being matched, which results in better error messages.

- Fix #3621: `///a#{1}///` compiles to `RegExp("a" + 1)`. So does
  `RegExp("a#{1}")`. Still, those two code snippets used to generate different
  tokens, which is a bit weird, but more importantly causes problems for
  coffeelint (see clutchski/coffeelint#340). This required lots of tests in
  test/location.coffee to be updated. Note that some updates to those tests are
  unrelated to this point; some have been updated to be more consistent (I
  discovered this because the refactored code happened to be seemingly more
  correct).

- Regular regex literals used to erraneously allow newlines to be escaped,
  causing invalid JavaScript output. This has been fixed.

- Heregexes may now be completely empty (`//////`), instead of erroring out with
  a confusing message.

- Fix #2388: Heredocs and heregexes used to be lexed simply, which meant that
  you couldn't nest a heredoc within a heredoc (double-quoted, that is) or a
  heregex inside a heregex.

- Fix #2321: If you used division inside interpolation and then a slash later in
  the string containing that interpolation, the division slash and the latter
  slash was erraneously matched as a regex. This has been fixed.

- Indentation inside interpolations in heredocs no longer affect how much
  indentation is removed from each line of the heredoc (which is more
  intuitive).

- Whitespace is now correctly trimmed from the start and end of strings in a few
  edge cases.

- Last but not least, the lexing of interpolated strings now seems to be more
  efficient. For a regular double-quoted string, we used to use a custom
  function to find the end of it (taking interpolations and interpolations
  within interpolations etc. into account). Then we used to re-find the
  interpolations and recursively lex their contents. In effect, the same string
  was processed twice, or even more in the case of deeper nesting of
  interpolations. Now the same string is processed just once.

- Code duplication between regular strings, heredocs, regular regexes and
  heregexes has been reduced.

- The above two points should result in more easily read code, too.
0dcff50
@lydell lydell Point "missing )/}/]" errors to the unclosed (/{/[
Previously such errors pointed at the end of the input, which wasn't very
helpful. This is also consistent with unclosed strings, where the errors point
at the opening quote.

Note that this includes unclosed #{ (interpolations).
ae6df88
@michaelficarra michaelficarra Merge pull request #3770 from lydell/interpolations
Refactor interpolation (and string and regex) handling in lexer
b70f657
Commits on Jan 05, 2015
@mbrio mbrio Fix issue #3498 8e299b0
@jashkenas Merge pull request #3771 from mbrio/master
Fix issue #3498
c478f28
Commits on Jan 06, 2015
@lydell lydell Fix #2516, #3560: Unicode space handling
It is possible to match only valid JavaScript identifiers with a really long
regex (like coco and CoffeeScriptRedux does), but CoffeeScript uses a much
simpler one, which allows a bit too much.

Quoting jashkenas/coffeescript#1718 #issuecomment-2152464 @jashkenas:

> But it still seems very much across the "worth it" line. You'll get the
> SyntaxError as soon as it hits JS, and performance aside -- even the increase
> in filesize for our browser coffee-script.js lib seems too much, considering
> this is something no one ever does, apart from experimentation.

In short, CoffeeScript treats any non-ASCII character as part of an identifier.
However, unicode spaces should be excluded since having blank characters as part
of a _word_ is very confusing. This commit does so, while still keeping the
regex really simple.
9ec427b
@jashkenas Merge pull request #3774 from lydell/unicode-spaces
Fix #2516, #3560: Unicode space handling
e769423
Commits on Jan 09, 2015
@lydell lydell Fix #3598: Make unary + and - generate _refs
Before commit c056c93 `Op::isComplex()` used to return true always. As far as I
understand, that commit attempts to exclude code such as `+1` and `-2` from
being marked as complex (and thus getting cached into `_ref` variables
sometimes). CoffeeScript is supposed to generate readable output so that choice
is understandable. However, it also excludes code such as `+a` (by mistake I
believe), which can cause `a` to be coerced multiple times. This commit fixes
this by only excluding unary + and - ops followed by a number.
2439877
Commits on Jan 10, 2015
@lydell lydell Fix #3410, #3182: Allow regex to start with space or =
A regex may not follow a specific set of tokens. These were already known before
in the `NOT_REGEX` and `NOT_SPACED_REGEX` arrays. (However, I've refactored them
to be more correct and to add a few missing tokens). In all other cases (except
after a spaced callable) a slash is the start of a regex, and may now start with
a space or an equals sign. It’s really that simple!

A slash after a spaced callable is the only ambigous case. We cannot know if
that's division or function application with a regex as the argument. The
spacing determines which is which:

Space on both sides:
- `a / b/i`  -> `a / b / i`
- `a /= b/i` -> `a /= b / i`

No spaces:
- `a/b/i`    -> `a / b / i`
- `a/=b/i`   -> `a /= b / i`

Space on the right side:
- `a/ b/i`   -> `a / b / i`
- `a/= b/i`  -> `a /= b / i`

Space on the left side:
- `a /b/i`   -> `a(/b/i)`
- `a /=b/i`  -> `a(/=b/i)`

The last case used to compile to `a /= b / i`, but that has been changed to be
consistent with the `/` operator. The last case really looks like a regex, so it
should be parsed as one.

Moreover, you may now also space the `/` and `/=` operators with other
whitespace characters than a space (such as tabs and non-breaking spaces) for
consistency.

Lastly, unclosed regexes are now reported as such, instead of generating some
other confusing error message.

It should perhaps also be noted that apart from escaping (such as `a /\ b/`) you
may now also use parentheses to disambiguate division and regex: `a (/ b/)`. See
#3182 (comment).
8fd6258
@lydell lydell Fix #3671: Allow step in optimized range comprehensions
Allow the `by c` part in `for [a..b] by c then`.

Continue disallowing a `when d` part, since it makes no sense having a guard
that isn't given access to anything that changes on every iteration.
a63009f
@michaelficarra michaelficarra Merge pull request #3783 from lydell/issue-3671
Fix #3671: Allow step in optimized range comprehensions
e0ad0d7
@michaelficarra michaelficarra Merge pull request #3777 from lydell/unary-plus-minus-refs
Fix #3598: Make unary + and - generate _refs
ac2e540
@michaelficarra michaelficarra Merge pull request #3782 from lydell/regex
Fix #3410, #3182: Allow regex to start with space or =
bec8f27
@josh josh Add test for reserved keywords as parameters 23a691a
@lydell lydell Fix #1500, #1574, #3318: Name generated vars uniquely
Any variables generated by CoffeeScript are now made sure to be named to
something not present in the source code being compiled. This way you can no
longer interfere with them, either on purpose or by mistake. (#1500, #1574)

For example, `({a}, _arg) ->` now compiles correctly. (#1574)

As opposed to the somewhat complex implementations discussed in #1500, this
commit takes a very simple approach by saving all used variables names using a
single pass over the token stream. Any generated variables are then made sure
not to exist in that list.

`(@a) -> a` used to be equivalent to `(@a) -> @a`, but now throws a runtime
`ReferenceError` instead (unless `a` exists in an upper scope of course). (#3318)

`(@a) ->` used to compile to `(function(a) { this.a = a; })`. Now it compiles to
`(function(_at_a) { this.a = _at_a; })`. (But you cannot access `_at_a` either,
of course.)

Because of the above, `(@a, a) ->` is now valid; `@a` and `a` are not duplicate
parameters.

Duplicate this-parameters with a reserved word, such as `(@case, @case) ->`,
used to compile but now throws, just like regular duplicate parameters.
8ab15d7
Commits on Jan 11, 2015
@lydell lydell Allow variables named like helper functions a469786
Commits on Jan 12, 2015
@lydell lydell Better error message for unexpected CALL_END 6271206
Commits on Jan 13, 2015
@michaelficarra michaelficarra Merge pull request #3788 from lydell/unexpected-call-end
Better error message for unexpected CALL_END
efd7ebb
@michaelficarra michaelficarra Merge pull request #3784 from lydell/unique-generated-vars
Unique generated vars
9fa77af
@lydell lydell Get rid of `Scope.root` hack
Using the static property `Scope.root` for the top-level scope of a file is a
hack, which makes it impossible to have several independent `Scope` instances
at the same time (should we ever need that).

This commit makes every instance have a reference to its root instead.
22f1952
@lydell lydell Fix #3502: Define param variables when expansion 4c2c472
@michaelficarra michaelficarra Merge pull request #3790 from lydell/scope-root
Get rid of `Scope.root` hack
4bf45ff
Commits on Jan 14, 2015
@michaelficarra michaelficarra Merge pull request #3791 from lydell/issue-3502
Fix #3502: Define param variables when expansion
669e7fe
@lydell lydell Fix #3194: Make strings always uncallable
No matter if they have interpolations or not.
fce502a
Commits on Jan 15, 2015
@lydell lydell Make CoffeeScript work with jison 0.4.14+
Since zaach/jison commit 3548861b, `parser.lexer` is never modified anymore (a
copy of it is made, and that copy is modified instead). CoffeeScript itself
modifies `parser.lexer` and then accesses those modifications in the custom
`parser.yy.parseError` function, but that of course does not work anymore. This
commit puts the data that `parser.yy.parseError` needs directly on the `parser`
so that it is not lost.

Supersedes #3603. Fixes #3608 and zaach/jison#243.
28c07d3
@michaelficarra michaelficarra Merge pull request #3794 from lydell/jison-update
Make CoffeeScript work with jison 0.4.14+
67aaa8b
@lydell lydell Make regexes always uncallable
No matter if they have interpolations or not.
3db029f
Commits on Jan 16, 2015
@michaelficarra michaelficarra Merge pull request #3792 from lydell/issue-3194
Fix #3194: Make strings always uncallable
5d1d1b7
@lydell lydell Fix #1316: Interpolate interpolations safely
Instead of compiling to `"" + + (+"-");`, `"#{+}-"'` now gives an appropriate
error message:

    [stdin]:1:5: error: unexpected end of interpolation
    "#{+}-"
        ^

This is done by _always_ (instead of just sometimes) wrapping the interpolations
in parentheses in the lexer. Unnecessary parentheses won't be output anyway.

I got tired of updating the tests in test/location.coffee (which I had enough of
in #3770), which relies on implementation details (the exact amount of tokens
generated for a given string of code) to do their testing, so I refactored them
to be less fragile.
05b3707
@michaelficarra michaelficarra Merge pull request #3787 from lydell/single-token-interpolation
Fix #1316: Interpolate interpolations safely
7d6f617
Commits on Jan 20, 2015
@ogennadi ogennadi Fixed broken link 42dde38
Commits on Jan 21, 2015
@michaelficarra michaelficarra Merge pull request #3798 from ogennadi/patch-1
Fixed broken link
68c0e2d
@ysmood ysmood Decouple "mkdirp"
Make coffee completely independent.
74fc712
Commits on Jan 26, 2015
@lydell lydell Fix #3804: Provide list of referenced vars to REPL
Supersedes #3805. Here is a comparison of master, #3805 and this commit:

    # master
    $ bin/coffee
    coffee> 1 %% 2
    TypeError: Array.prototype.indexOf called on null or undefined

    # #3805
    $ bin/coffee
    coffee> 1 %% 2
    1
    coffee> (_results = null; i) for i in [1, 2, 3]
    TypeError: Cannot call method 'push' of null

    # this commit
    $ bin/coffee
    coffee> 1 %% 2
    1
    coffee> (_results = null; i) for i in [1, 2, 3]
    [ 1, 2, 3 ]
8ed691e
@michaelficarra michaelficarra Merge pull request #3807 from lydell/repl-fix
Fix #3804: Provide list of referenced vars to REPL
518d7c1
@lydell lydell Fix broken CoffeeScript APIs
As evidenced in #3804, commit 8ab15d7 broke the CoffeeScript API. The REPL uses
those APIs, but wasn't updated in that commit. Still, that shouldn't have
_broken_ the REPL. The reason it broke is because the added _option_
'referencedVars' wasn't actually _optional;_ if it was omitted code that relies
on it being set broke. This commit defaults that option to an empty array, which
makes things behave exactly like before when the 'referencedVars' option is
omitted.
54a4560
@michaelficarra michaelficarra Merge pull request #3808 from lydell/api-break-fix
Fix broken CoffeeScript APIs
dca915a
Commits on Jan 28, 2015
@xfq xfq Update index.html.js
Node comes with npm installed and "npm" is not an abbreviation for "Node Package Manager".
f288d20
@michaelficarra michaelficarra Merge pull request #3812 from xfq/patch-1
Update index.html.js
2f0724f
@ysmood ysmood Add test for mkdirp 3d58b4c
@ysmood ysmood Optimize the mkdirp test 90a1cba
Commits on Jan 29, 2015
@jashkenas rebuilt browser just for testing 06e8be5
@jashkenas Merge pull request #3800 from ysmood/decouple_mkdirp
Decouple "mkdirp".
9a38486
@jashkenas removing the mkdirp test a62e493
@jashkenas CoffeeScript 1.9.0 e0ec8a5
@jashkenas text tweak 9aeecf5
@jashkenas Merge branch 'gh-pages' cdf69eb
@jashkenas more text tweaks f7692c9