-
-
Notifications
You must be signed in to change notification settings - Fork 220
Closed
Labels
bugConfirmed bugConfirmed bug
Description
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)
...
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}
Note: removing , x = null
produces correct output. Alternatively returning x + z
produces correct output (REPL)
Metadata
Metadata
Assignees
Labels
bugConfirmed bugConfirmed bug