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

espree Cannot read property 'start' of undefined #247

Closed
mysticatea opened this issue Jan 30, 2016 · 2 comments
Closed

espree Cannot read property 'start' of undefined #247

mysticatea opened this issue Jan 30, 2016 · 2 comments

Comments

@mysticatea
Copy link
Member

I encountered a fatal error with the code: ({a, ...b} = {a, ...b}).
This code can be parsed on espree@2, but cannot on espree@3.

"use strict";

const espree = require("espree");
const ast = espree.parse(
    "({a, ...b} = {a, ...b})",
    {ecmaVersion: 6, ecmaFeatures: {experimentalObjectRestSpread: true}}
);

console.log("espree", JSON.stringify(ast, null, 4));
C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:1041
          if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter");
                                                       ^

TypeError: Cannot read property 'start' of undefined
    at Parser.pp.toAssignable (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:1041:56)
    at Parser.pp.parseMaybeAssign (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:116:58)
    at Parser.pp.parseParenAndDistinguishExpression (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:374:28)
    at Parser.pp.parseExprAtom (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:297:19)
    at Parser.pp.parseExprSubscripts (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:216:19)
    at Parser.pp.parseMaybeUnary (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:197:19)
    at Parser.pp.parseExprOps (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:151:19)
    at Parser.pp.parseMaybeConditional (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:133:19)
    at Parser.pp.parseMaybeAssign (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:110:19)
    at Parser.pp.parseExpression (C:\Users\t-nagashima.AD\Documents\GitHub\eslint\node_modules\acorn\dist\acorn.js:86:19)
@nzakas
Copy link
Member

nzakas commented Jan 31, 2016

Thanks, I'll take a look.

@nzakas nzakas closed this as completed in ea6261e Feb 2, 2016
nzakas added a commit that referenced this issue Feb 2, 2016
Fix: Object rest/spread in assign (fixes #247)
@mysticatea
Copy link
Member Author

Thank you!

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

2 participants