2.0.2 by GeoffreyBooth · Pull Request #4758 · jashkenas/coffeescript

This should hopefully be the last release for awhile, unless people report cringeworthy bugs.

This PR adds a new breaking changes section about super and this.

2.0.2 changelog:

  • --transpile now also applies to required or imported CoffeeScript files.
  • --transpile can be used with the REPL: coffee --interactive --transpile.
  • Improvements to comments output that should now cover all of the Flow comment-based syntax. Inline ### comments near variable initial assignments are now output in the variable declaration statement, and ### comments near a class and method names are now output where Flow expects them.
  • Importing CoffeeScript keywords is now allowed, so long as they’re aliased: import { and as andFn } from 'lib'. (You could also do import lib from 'lib' and then reference lib.and.)
  • Calls to functions named get and set no longer throw an error when given a bracketless object literal as an argument: obj.set propertyName: propertyValue.
  • In the constructor of a derived class (a class that extends another class), you cannot call super with an argument that references this: class Child extends Parent then constructor: (@arg) -> super(@arg). This isn’t allowed in JavaScript, and now the CoffeeScript compiler will throw an error. Instead, assign to this after calling super: (arg) -> super(arg); @arg = arg.
  • Bugfix for incorrect output when backticked statements and hoisted expressions were both in the same class body. This allows a backticked line like `field = 3`, for people using the experimental class fields syntax, in the same class along with traditional class body expressions like prop: 3 that CoffeeScript outputs as part of the class prototype.
  • Bugfix for comments not output before a complex ? operation, e.g. @a ? b.
  • All tests now pass in Windows.

@jashkenas @lydell @connec @vendethiel