5 * Unicode characters in identifiers (improved).
6 * [Delegating yield](http://wiki.ecmascript.org/doku.php?id=harmony:generators#delegating_yield).
7 * [ES6 numeric literals](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-numeric-literals) (octal, binary).
8 * Harmony [array and generator comprehensions](http://wingolog.org/archives/2014/03/07/es6-generator-and-array-comprehensions-in-spidermonkey).
14 * [Arrow functions](http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax)
15 * [Generators](http://wiki.ecmascript.org/doku.php?id=harmony:generators)
16 * [Spread operator](http://wiki.ecmascript.org/doku.php?id=harmony:spread)
20 ### Support for JSLint global declaration
22 See the docstring for `js2-include-jslint-globals`.
26 ### We don't rebind `RET` anymore
28 Because well-behaving major modes aren't supposed to do that.
30 So pressing it won't continue a block comment, or turn a string into a concatenation.
31 Pressing `M-j`, however, will.
33 The options `js2-indent-on-enter-key` and `js2-enter-indents-newline` were also removed.
35 To bring back the previous behavior, put this in your init file:
37 (eval-after-load 'js2-mode
38 '(define-key js2-mode-map (kbd "RET") 'js2-line-break))
42 ### Support for [default](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/default_parameters) and [rest](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/rest_parameters) parameters
46 ### Support for [for..of loops](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of)
50 ### Popular indentation style
52 [foo, bar, baz].forEach(function (v) {
57 [a, b, c].some(function (v) {
61 ### Pretty multiline variable declaration
69 In this mode when the value of `js2-pretty-multiline-declarations` is non-nil,
75 ### Abbreviated destructuring assignments
77 let {a, b} = {a: 10, b: 20}; // Abbreviated (Not supported in the original mode)
78 let {a: a, b: b} = {a: 10, b: 20}; // Same as above (Supported in the original mode)
80 (function ({responseText}) { /* */ })(xhr); // As the argument of function
82 for (let [k, { name, age }] in Iterator(obj)) // nested
85 ### Expression closure in property value
90 fire: function () _fire()
93 ### Fix for odd indentation of "else if" with no braces
109 ### Imenu support for function nesting
111 Supports function nesting and anonymous wrappers:
114 var foo = function() {
115 function bar() { // shown as foo.bar.<definition-1>
116 function baz() {} // foo.bar.baz
117 var qux = function() {}; // foo.bar.quux
124 * [jQuery 1.5](https://gist.github.com/845449)
125 * [Underscore.js](https://gist.github.com/824262)
126 * [Backbone.js](https://gist.github.com/824260)
128 For library-specific extension methods like `$.extend` and `dojo.declare`, see [js2-imenu-extras](/mooz/js2-mode/blob/master/js2-imenu-extras.el).
130 ### Undeclared/external variables highlighting
132 Original mode highlights them only on the left side of assignments:
135 hose = new House(); // highlights "hose"
137 Here they are highlighted in all expressions:
139 function feed(fishes, food) {
140 for each (var fish in fshes) { // highlights "fshes"
141 food.feed(fsh); // highlights "fsh"
143 hood.discard(); // highlights "hood"
146 Destructuring assignments and array comprehensions (JS 1.7) are supported:
148 let three, [one, two] = [1, 2];
149 thee = one + two; // highlights "thee"
151 function revenue(goods) {
152 // highlights "coast"
153 return [price - coast for each ({price, cost} in goods)].reduce(add);