Fix arrow functions with destructuring, types & default value (#94)
Flow's "toAssignable" override wasn't calling the inner function, resulting in the destructuring in an AssignmentPattern not having the node type changed from ObjectExpression to ObjectPattern, resulting in "Binding rvalue" thrown from "checkLVal()"
This commit is contained in:
@@ -878,11 +878,11 @@ export default function (instance) {
|
||||
});
|
||||
|
||||
instance.extend("toAssignable", function (inner) {
|
||||
return function (node) {
|
||||
return function (node, isBinding) {
|
||||
if (node.type === "TypeCastExpression") {
|
||||
return this.typeCastToParameter(node);
|
||||
return inner.call(this, this.typeCastToParameter(node), isBinding);
|
||||
} else {
|
||||
return inner.apply(this, arguments);
|
||||
return inner.call(this, node, isBinding);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user