documentation/sections/changelog/2.2.0.md
releaseHeader('2018-02-01', '2.2.0', '2.1.1')
if or switch statement with an ambiguous else, such as if no then if yes then alert 1 else alert 2, now compiles where the else always corresponds to the closest open then. Previously the behavior of an ambiguous else was unpredictable. If your code has any if … then or switch … then statements with multiple thens (and one or more elses) the compiled output might be different now, unless you had resolved ambiguity via parentheses. We made this change because the previous behavior was inconsistent and basically a bug: depending on what grammar was where, for example if there was an inline function or something that implied a block, the else might bind to an earlier then rather than a later then. Now an else essentially closes a block opened by a then, similar to closing an open parenthesis.then is missing, the error more accurately points out the location of the mistake.coffee command is run in an environment that doesn’t support some ES2015 JavaScript features that the CoffeeScript compiler itself requires. This can happen if CoffeeScript is installed in Node older than version 6.[open, contents..., close] = tag.split('') is now output using ES2015 rest syntax.get or set can be used without parentheses in more cases, including when attached to this or @ or ?.; or when the first argument is an implicit object, e.g. @set key: 'val'.break can now be used inside parentheses, e.g. (doSomething(); break) while condition or (pick(key); break) for key of obj.this/@ in destructuring, e.g. ({@prop = yes, @otherProp = no}) ->.super with a parameter attached to this when said parameter is in a lower scope, e.g. class Child extends Parent then constructor: -> super(-> @prop).for loop is given a variable to step by, e.g. for x in [1..3] by step (as opposed to by 0.5 or some other primitive numeric value).end = 3; fn [0..end].start(x = 3).then(-> x = 4).do, e.g. for [1..3] then masked = 10; do -> alert masked.fn arg1, arg2,.a[!b in c..].\) at any point in a for line.