## Change Log ``` releaseHeader('2017-01-24', '1.12.3', '1.12.2') ``` * `@` values can now be used as indices in `for` expressions. This loosens the compilation of `for` expressions to allow the index variable to be an `@` value, e.g. `do @visit for @node, @index in nodes`. Within `@visit`, the index of the current node (`@node`) would be available as `@index`. * CoffeeScript’s patched `Error.prepareStackTrace` has been restored, with some revisions that should prevent the erroneous exceptions that were making life difficult for some downstream projects. This fixes the incorrect line numbers in stack traces since 1.12.2. * The `//=` operator’s output now wraps parentheses around the right operand, like the other assignment operators. ``` releaseHeader('2016-12-16', '1.12.2', '1.12.1') ``` * The browser compiler can once again be built unminified via `MINIFY=false cake build:browser`. * The error-prone patched version of `Error.prepareStackTrace` has been removed. * Command completion in the REPL (pressing tab to get suggestions) has been fixed for Node 6.9.1+. * The [browser-based tests](v<%= majorVersion %>/test.html) now include all the tests as the Node-based version. ``` releaseHeader('2016-12-07', '1.12.1', '1.12.0') ``` * You can now import a module member named `default`, e.g. `import { default } from 'lib'`. Though like in ES2015, you cannot import an entire module and name it `default` (so `import default from 'lib'` is not allowed). * Fix regression where `from` as a variable name was breaking `for` loop declarations. For the record, `from` is not a reserved word in CoffeeScript; you may use it for variable names. `from` behaves like a keyword within the context of `import` and `export` statements, and in the declaration of a `for` loop; though you should also be able to use variables named `from` in those contexts, and the compiler should be able to tell the difference. ``` releaseHeader('2016-12-04', '1.12.0', '1.11.1') ``` * CoffeeScript now supports ES2015 [tagged template literals](#tagged-template-literals). Note that using tagged template literals in your code makes you responsible for ensuring that either your runtime supports tagged template literals or that you transpile the output JavaScript further to a version your target runtime(s) support. * CoffeeScript now provides a [`for…from`](#generator-iteration) syntax for outputting ES2015 [`for…of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of). (Sorry they couldn’t match, but we came up with `for…of` first for something else.) This allows iterating over generators or any other iterable object. Note that using `for…from` in your code makes you responsible for ensuring that either your runtime supports `for…of` or that you transpile the output JavaScript further to a version your target runtime(s) support. * Triple backticks (`` ```​``) allow the creation of embedded JavaScript blocks where escaping single backticks is not required, which should improve interoperability with ES2015 template literals and with Markdown. * Within single-backtick embedded JavaScript, backticks can now be escaped via `` \`​``. * The browser tests now run in the browser again, and are accessible [here](v<%= majorVersion %>/test.html) if you would like to test your browser. * CoffeeScript-only keywords in ES2015 `import`s and `export`s are now ignored. * The compiler now throws an error on trying to export an anonymous class. * Bugfixes related to tokens and location data, for better source maps and improved compatibility with downstream tools. ``` releaseHeader('2016-10-02', '1.11.1', '1.11.0') ``` * Bugfix for shorthand object syntax after interpolated keys. * Bugfix for indentation-stripping in `"""` strings. * Bugfix for not being able to use the name “arguments” for a prototype property of class. * Correctly compile large hexadecimal numbers literals to `2e308` (just like all other large number literals do). ``` releaseHeader('2016-09-24', '1.11.0', '1.10.0') ``` * CoffeeScript now supports ES2015 [`import` and `export` syntax](#modules). * Added the `-M, --inline-map` flag to the compiler, allowing you embed the source map directly into the output JavaScript, rather than as a separate file. * A bunch of fixes for `yield`: * `yield return` can no longer mistakenly be used as an expression. * `yield` now mirrors `return` in that it can be used stand-alone as well as with expressions. Where you previously wrote `yield undefined`, you may now write simply `yield`. However, this means also inheriting the same syntax limitations that `return` has, so these examples no longer compile: ``` doubles = -> yield for i in [1..3] i * 2 six = -> yield 2 * 3 ``` * The JavaScript output is a bit nicer, with unnecessary parentheses and spaces, double indentation and double semicolons around `yield` no longer present. * `&&=`, `||=`, `and=` and `or=` no longer accidentally allow a space before the equals sign. * Improved several error messages. * Just like `undefined` compiles to `void 0`, `NaN` now compiles into `0/0` and `Infinity` into `2e308`. * Bugfix for renamed destructured parameters with defaults. `({a: b = 1}) ->` no longer crashes the compiler. * Improved the internal representation of a CoffeeScript program. This is only noticeable to tools that use `CoffeeScript.tokens` or `CoffeeScript.nodes`. Such tools need to update to take account for changed or added tokens and nodes. * Several minor bug fixes, including: * The caught error in `catch` blocks is no longer declared unnecessarily, and no longer mistakenly named `undefined` for `catch`-less `try` blocks. * Unassignable parameter destructuring no longer crashes the compiler. * Source maps are now used correctly for errors thrown from .coffee.md files. * `coffee -e 'throw null'` no longer crashes. * The REPL no longer crashes when using `.exit` to exit it. * Invalid JavaScript is no longer output when lots of `for` loops are used in the same scope. * A unicode issue when using stdin with the CLI. ``` releaseHeader('2015-09-03', '1.10.0', '1.9.3') ``` * CoffeeScript now supports ES2015-style destructuring defaults. * `(offsetHeight: height) ->` no longer compiles. That syntax was accidental and partly broken. Use `({offsetHeight: height}) ->` instead. Object destructuring always requires braces. * Several minor bug fixes, including: * A bug where the REPL would sometimes report valid code as invalid, based on what you had typed earlier. * A problem with multiple JS contexts in the jest test framework. * An error in io.js where strict mode is set on internal modules. * A variable name clash for the caught error in `catch` blocks. ``` releaseHeader('2015-05-27', '1.9.3', '1.9.2') ``` * Bugfix for interpolation in the first key of an object literal in an implicit call. * Fixed broken error messages in the REPL, as well as a few minor bugs with the REPL. * Fixed source mappings for tokens at the beginning of lines when compiling with the `--bare` option. This has the nice side effect of generating smaller source maps. * Slight formatting improvement of compiled block comments. * Better error messages for `on`, `off`, `yes` and `no`. ``` releaseHeader('2015-04-15', '1.9.2', '1.9.1') ``` * Fixed a **watch** mode error introduced in 1.9.1 when compiling multiple files with the same filename. * Bugfix for `yield` around expressions containing `this`. * Added a Ruby-style `-r` option to the REPL, which allows requiring a module before execution with `--eval` or `--interactive`. * In `