* Rephrase "assigning/binding to rvalue" error messages with context (#119) * Fix code style in parser/lval.js * istanbul ignore some unused branches in parser/lval.js * Fix code style again in parser/lval.js
This commit is contained in:
committed by
Henry Zhu
parent
650e33376a
commit
774e6b446b
@@ -904,25 +904,25 @@ export default function (instance) {
|
||||
});
|
||||
|
||||
instance.extend("toAssignable", function (inner) {
|
||||
return function (node, isBinding) {
|
||||
return function (node, isBinding, contextDescription) {
|
||||
if (node.type === "TypeCastExpression") {
|
||||
return inner.call(this, this.typeCastToParameter(node), isBinding);
|
||||
return inner.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
|
||||
} else {
|
||||
return inner.call(this, node, isBinding);
|
||||
return inner.call(this, node, isBinding, contextDescription);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// turn type casts that we found in function parameter head into type annotated params
|
||||
instance.extend("toAssignableList", function (inner) {
|
||||
return function (exprList, isBinding) {
|
||||
return function (exprList, isBinding, contextDescription) {
|
||||
for (let i = 0; i < exprList.length; i++) {
|
||||
let expr = exprList[i];
|
||||
if (expr && expr.type === "TypeCastExpression") {
|
||||
exprList[i] = this.typeCastToParameter(expr);
|
||||
}
|
||||
}
|
||||
return inner.call(this, exprList, isBinding);
|
||||
return inner.call(this, exprList, isBinding, contextDescription);
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user