yoya / js2-mode

Automatically exported from code.google.com/p/js2-mode
0 stars 0 forks source link

Array assignment with missing elements breaks parser #110

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Using js2-20090723b.el.

In one of the Mozilla Fennec source files, we have this method defined:

  isTabsVisible: function isTabsVisible() {
    let [leftvis,,,] = Browser.computeSidebarVisibility();
    return (leftvis > 0.002);
  },

This breaks the js2 parser with the error "Wrong type argument: arrayp,
nil" in the status bar, and prevents building the JS AST for code coloring.

This is legal code; destructing assignment was added in JavaScript 1.7. 
See https://developer.mozilla.org/en/New_in_JavaScript_1.7#section_26 .

The source file that fails is available at
http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser-ui.js.
 If you remove that method, the whole file does parse.

Original issue reported on code.google.com by ben.combee on 27 Aug 2009 at 1:58

GoogleCodeExporter commented 8 years ago
This was using Emacs 23.1 on Windows Vista.

Original comment by ben.combee on 27 Aug 2009 at 1:58