New capabilities were done with few breaking changes from the 1.x version, CoffeeScript developers said. Previously, the team had warned that CoffeeScript 2 would require breaking changes to conform with the ECMAScript 2015 specification and above. “Most current CoffeeScript projects should be able to upgrade with little or no refactoring necessary,” the developers said. The few breaking changes involve bound (fat arrow) functions, bound generator functions, and Literate CoffeeScript parsing, which has been refactored to be more careful about not treating indented lists as code blocks.
With version 2, CoffeeScript now outputs line comments, after having discarded them in version 1.1. Block comments are now permitted anywhere, enabling static type annotations. The coffee command-line tool has been improved in the upgrade as well.
var, named functions, and the
set keywords. Whereas
let and named functions were omitted for simplicity’s sake,
var was left out so that CoffeeScript developers would not have to deal with variable declarations, and the