jashkenas--coffeescript/documentation/sections/compatibility.md

1.2 KiB
Raw Blame History

Compatibility

With the exception of modules (import and export statements) and JSX, all the modern JavaScript features that CoffeeScript supports can run natively in Node 7.6+, meaning that Node can run CoffeeScripts output without any further processing required. You can run the tests in your browser to see if your browser can do the same. For older browsers or older versions of Node, however, transpilation is required.

Support for modern JavaScript syntax is important to ensure compatibility with frameworks that assume modern features. Now that CoffeeScript compiles classes to the class keyword, its possible to extend a JavaScript class; that wasnt possible in CoffeeScript 1. Parity in how language features work is also important on its own; CoffeeScript “is just JavaScript,” and so things like function parameter default values should behave the same in CoffeeScript as in JavaScript. Some such features behave slightly differently in JavaScript than they did in CoffeeScript 1; in such cases we are conforming with the JavaScript spec, and weve documented the differences as breaking changes.