binjs-ref
binjs-ref copied to clipboard
AST node type mismatch
Not sure if this was introduced when migrating Shift conversions to JS or existed earlier, but, either way, currently:
let {x: y = 1} = {};
fails to parse/encode with
Could not parse source: JSONError(Error("unknown variant `BindingWithDefault`, expected one of `BindingWithInitializer`, `ObjectBinding`, `BindingIdentifier`, `ArrayBinding`", line: 1, column: 325))
because corresponding Shift node is called BindingWithDefault, but BinaryAST node is called BindingWithInitializer.
Either from-shift.js should be adjusted to convert this node type, or BinaryAST node should be renamed.
@xtuc want to take this? If possible, I'd like the fix to be in from_shift.js.