## Change Log ``` releaseHeader('2017-11-29', '1.12.8', '1.12.7') ``` * Added install message on `coffee-script` package encouraging people to use the `coffeescript` NPM package instead. * Backported bugfix for `export default` followed by an implicit object that contains an explicit object, for example `exportedMember: { obj... }`. * Backported bugfix for splats after existential operator soaks in arrays (`[a?.b...]`) or expressions. ``` releaseHeader('2017-07-16', '1.12.7', '1.12.6') ``` * Fix regressions in 1.12.6 related to chained function calls and indented `return` and `throw` arguments. * The REPL no longer warns about assigning to `_`. ``` releaseHeader('2017-05-15', '1.12.6', '1.12.5') ``` * The `return` and `export` keywords can now accept implicit objects (defined by indentation, without needing braces). * Support Unicode code point escapes (e.g. `\u{1F4A9}`). * The `coffee` command now first looks to see if CoffeeScript is installed under `node_modules` in the current folder, and executes the `coffee` binary there if so; or otherwise it runs the globally installed one. This allows you to have one version of CoffeeScript installed globally and a different one installed locally for a particular project. (Likewise for the `cake` command.) * Bugfixes for chained function calls not closing implicit objects or ternaries. * Bugfixes for incorrect code generated by the `?` operator within a termary `if` statement. * Fixed some tests, and failing tests now result in a nonzero exit code. ``` releaseHeader('2017-04-10', '1.12.5', '1.12.4') ``` * Better handling of `default`, `from`, `as` and `*` within `import` and `export` statements. You can now import or export a member named `default` and the compiler won’t interpret it as the `default` keyword. * Fixed a bug where invalid octal escape sequences weren’t throwing errors in the compiler. ``` releaseHeader('2017-02-18', '1.12.4', '1.12.3') ``` * The `cake` commands have been updated, with new `watch` options for most tasks. Clone the [CoffeeScript repo](https://github.com/jashkenas/coffeescript) and run `cake` at the root of the repo to see the options. * Fixed a bug where `export`ing a referenced variable was preventing the variable from being declared. * Fixed a bug where the `coffee` command wasn’t working for a `.litcoffee` file. * Bugfixes related to tokens and location data, for better source maps and improved compatibility with downstream tools. ``` 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](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](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 `