Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array assignment with missing elements breaks parser #110

Open
GoogleCodeExporter opened this issue Apr 2, 2015 · 1 comment
Open

Array assignment with missing elements breaks parser #110

GoogleCodeExporter opened this issue Apr 2, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

This was using Emacs 23.1 on Windows Vista.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant