Skip to content

Intentional deviations from jashkenas coffee script

Simon Kerouack edited this page Mar 5, 2015 · 3 revisions

The goal of this page is to build an exhaustive list of deviations (either in accepted language or output semantics) from jashkenas/coffee-script.

  • Unintentional deviations that are known will be listed among the issues labeled bug or on the roadmap.

  • Intentional deviations will not be listed here, as the command line and module interfaces have been drastically changed. It was never a goal of this project to have compatible interfaces suitable for drop-in replacement.

About CS bugs fixed in Redux

Many bugs from jashkenas/coffee-script have been fixed in this implementation. I tagged all open bugs which were fixed by this project with fixed in redux.

Although some have since been fixed in jashkenas/coffee-script, many are still open. At the time of this writing: 37 are still open; 91 have been closed.

A couple quick examples:

  • coffee-script #1275: The most notable fixed in redux bug—which involves a fairly major change to the language—is the sub-block terminator issue. Each indentation level must be consistently indented until its parent is closed.

  • coffee-script #1601: Fixed in redux. This issue proposed removing the postfix operator (::).


And now, on to the deviations!


Intentional Deviations

  • coffee-script #2323: Explicit require.extensions registration. In order to require .coffee files, you must explicitly register the CoffeeScript compiler instance with that extension. Simply call the module’s CoffeeScript.register method or require coffee-script-redux/register. This corresponds to the planned change in jashkenas/coffee-script#2323, but it is not implemented yet in jashkenas/coffee-script, so could easily trip people up. Now fixed in CoffeeScript!

  • #208: Semicolon operator. Semicolons are semantic. See the issue discussion. They will still work at the end of most lines, but you should only use them as you would JavaScript’s sequence (comma) operator. Using semicolons as line terminators has always been highly discouraged.

  • #43: Assignment as right operand of higher-precedence infix operators.

  • #197: A try/finally block, where the finally block is empty. This implies an empty catch, just like try with no catch or finally.