Commit Graph

25 Commits

Author SHA1 Message Date
Simon Lydell 9ec427ba80 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.
2015-01-06 21:32:14 +01:00
Marc Häfner 26200f4640 Improve HEREDOC regexp
* Exclude trailing blank line from the match group
  * Fix backslash handling
2013-11-28 16:46:00 +01:00
xixixao b11d956d53 Added compilation regression test 2013-11-27 12:58:14 +00:00
Jeremy Ashkenas d5a25d138d Fixes #3089 -- don't mutate options passed in to compile() 2013-10-20 16:21:06 -03:00
Marc Häfner fdd5796f5e Disallow single-line `IF expr ELSE` without `THEN`
* Supplement missing block before `ELSE` token only for multi-line `if`.
* Don't prematurely remove `TERMINATOR` before `ELSE` (so we can  differentiate single- and multi-line forms).
* Cleanup: Remove `WHEN` from `EXPRESSION_CLOSE`. (Only `LEADING_WHEN` tokens are preceded by a `TERMINATOR`.)
* Cleanup: Remove really old, inapplicable text from comment.
2013-07-30 19:31:46 +02:00
Nami-Doc b3ffd25339 Disallowed `for own in` 2013-05-26 00:29:26 +02:00
Nami-Doc 1917bb69ed Fix #2944 2013-04-21 12:33:00 +02:00
Nami-Doc 53a5f26430 fix #2846 2013-03-25 18:56:24 +01:00
Jeremy Ashkenas de8ec2beb0 Fixes #1066 -- interpolated strings are not implicit funcs 2013-03-05 21:28:29 +13:00
Jeremy Ashkenas 355754ed20 Fixes #1055 -- disallow invalid keys in object literals ... but allow them where the implicit object is being used as a class defn' or a destructuring 2013-03-05 21:10:56 +13:00
Trevor Burnham 16e297ab61 Adding test to ensure that header is disabled by default 2012-01-10 14:03:48 -05:00
Trevor Burnham 36a69864e3 Adding support for a header with version number to CoffeeScript.compile (#1778) 2012-01-10 12:54:21 -05:00
Michael Ficarra d0b8cded6b 1e25c9da306f38ddf7bd3c63ed7c9540b75384e0#commitcomment-719177 2011-11-14 11:18:45 -05:00
Jeremy Ashkenas 1a652a9736 CoffeeScript 1.1.2 2011-08-04 23:17:23 -04:00
Michael Ficarra e4f47a05f6 merging @TrevorBurnham's pull request #1314, enhancing `CS.eval`; closes #1314 2011-05-25 03:53:51 -04:00
Jeremy Ashkenas 76252659fd Merge pull request #1300 from michaelficarra/issue1106.
fixes issue #1106
2011-04-30 07:29:41 -07:00
Michael Ficarra 7efea4bb23 removed "globals" option of CoffeeScript.compile and enhanced fix from
previous commits
2011-04-29 15:53:30 -04:00
Michael Ficarra 5cd5821c18 #1106 test case: making sure `__proto__` exists in case v8 ever removes it 2011-04-27 18:57:22 -07:00
Michael Ficarra cd8492dd7b test for #1106 2011-04-27 21:36:29 -04:00
Jeremy Ashkenas ac85fa2fc3 merged stable 2011-03-11 22:44:18 -05:00
Jeremy Ashkenas 2b1aea80ed testified compilation.coffee, removed empty command.coffee 2011-03-11 21:59:17 -05:00
Jeremy Ashkenas 4b78790096 Making #1050 a syntax error. 2011-01-18 23:10:09 -05:00
Jeremy Ashkenas 7c7b9a4be1 Merging in 1035 fix. fileName -> filename ... a bit of refactoring. 2011-01-15 10:46:53 -05:00
Jeremy Ashkenas 9b3197c6e8 #1026 2011-01-10 23:19:31 -05:00
Michael Ficarra dcbe62b9b9 test reorganization waypoint 3 2010-12-30 22:48:31 -05:00