Back to Coffeescript

2.0.2

documentation/sections/changelog/2.0.2.md

2.7.01.9 KB
Original Source
releaseHeader('2017-10-26', '2.0.2', '2.0.1')
  • --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.