Repository navigation
First release with language changes that add syntax on top of CoffeeScript 1.12.7.
- Add
const, which declares a block scoped JSconstat the statement site instead of a hoistedvar, with the name still reserved for the whole function at compile time so it can't be redeclared, shadowed, or reassigned - Compile
constdestructuring to native JS destructuring instead of the expanded ES5 form, so defaults apply only toundefinedand array patterns use the iterator protocol, matching CoffeeScript 2 - Report compile errors for reassigning a
const(including+=,++, loop variables, and writes from nested functions), redeclaring a name, usingconstas an expression, and patterns JS destructuring can't express - Add
await, following the CoffeeScript 2 design: there is noasynckeyword, a function whose body containsawaitcompiles toasync function - Support
awaitin bound functions, in comprehensions used as expressions (wrapped in an async IIFE), and asawait return - Report compile errors for
awaitoutside a function, a function mixingyieldandawait, andawaitin a class constructor awaitis now a keyword, so it can no longer be used as a variable name the way it could in CoffeeScript 1.x, property access is emitted asa["await"]like other keywords
Code that uses none of the new syntax still compiles byte-for-byte identical to CoffeeScript 1.12.7.
Full Changelog: v1.1.0...v1.2.0