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

Another "Cannot read property 'end' of null" error #615

Closed
zamb3zi opened this issue Jul 3, 2017 · 1 comment
Closed

Another "Cannot read property 'end' of null" error #615

zamb3zi opened this issue Jul 3, 2017 · 1 comment
Labels
bug Confirmed bug

Comments

@zamb3zi
Copy link

zamb3zi commented Jul 3, 2017

Input

function foo(arg) {
    const { y } = arg, { z, x = null } = y;
    return z ? z : null;
}

Output

TypeError: test3.js: Cannot read property 'end' of null
    at _evaluate (C:\Users\John\Documents\GitHub\babili\packages\babili\node_modules\babel-traverse\lib\path\evaluation.js:159:57)
    at evaluate (C:\Users\John\Documents\GitHub\babili\packages\babili\node_modules\babel-traverse\lib\path\evaluation.js:65:17)
    ...

REPL

The following version does not produce an exception but generates incorrect output:

Input

function foo(arg) {
    const { y } = arg, { z, x = null } = y;
    return z;
}

Output

function foo(a){const{y:b}=a;return z}

REPL

Note: removing , x = null produces correct output. Alternatively returning x + z produces correct output (REPL)

@boopathi boopathi added the bug Confirmed bug label Jul 8, 2017
@boopathi
Copy link
Member

boopathi commented Jul 8, 2017

#622 fixes this

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

No branches or pull requests

2 participants