3 ms·
Off the top of my head, features that are entirely syntactical transformations and don't need a runtime: - Classes (except inheritance requires a tiny shim fun
by Arnavion 12y ago
Off the top of my head, features that are entirely syntactical transformations and don't need a runtime:
- Classes (except inheritance requires a tiny shim function)
- Destructuring (except destructuring iterators)
- Rest parameters
- Arrow functions
- Shorthand object literals
- Computed properties
- Template strings (although tagged template strings require a non-trivial amount of shimming to mimic)
- let and const (check correctness before transpiling, then compile to var. Transformation is non-trivial when inside loops, etc.)
- Modules
Features that do require a runtime / library:
- Iterators and generators
- Promises
- Symbols
- New ES6 methods on Object, Number, String, etc. (like Number.isNaN)
- andrewingram 12y agoI think to use the more advanced features of modules, ie default exports, you do need a run-time.