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

Destructuring Defaults throws Unknown node type Error #1986

Closed
kentor opened this Issue Mar 9, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@kentor
Copy link
Contributor

kentor commented Mar 9, 2015

package.json:

{
  "devDependencies": {
    "eslint": "^0.16.1"
  }
}

index.js:

var { a='a' } = {};

.eslintrc:

---
env:
  es6: true
$ ./node_modules/.bin/eslint index.js

/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/estraverse/estraverse.js:517
                        throw new Error('Unknown node type ' + nodeType + '.')
                              ^
Error: Unknown node type AssignmentPattern.
    at Controller.traverse (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/estraverse/estraverse.js:517:31)
    at Object.traverse (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/estraverse/estraverse.js:709:27)
    at traverseIdentifierInPattern (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/escope.js:879:20)
    at Referencer.extend.visitPattern (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/escope.js:1024:13)
    at Referencer.extend.visitVariableDeclaration (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/escope.js:1168:18)
    at Referencer.extend.VariableDeclaration (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/escope.js:1336:22)
    at Referencer.Visitor.visit (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js:109:34)
    at Referencer.Visitor.visitChildren (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js:88:38)
    at Referencer.extend.Program (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/escope.js:1236:18)
    at Referencer.Visitor.visit (/Users/kenneth/stuff/eslint-test/node_modules/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js:109:34)

@kentor kentor changed the title Destructuring Default throws Unknown node type Error Destructuring Defaults throws Unknown node type Error Mar 9, 2015

@nzakas

This comment has been minimized.

Copy link
Member

nzakas commented Mar 9, 2015

This is an issue with estraverse not understanding what it's seeing. A new version was just released, so I'll try to plug it in today.

@nzakas nzakas added the bug label Mar 10, 2015

@nzakas nzakas closed this in e174ab1 Mar 10, 2015

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.