fix: add optional: false to MemberExpression (#11709)
This commit is contained in:
parent
3fba9710dc
commit
b27abd39a8
@ -394,6 +394,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
delete node.arguments;
|
delete node.arguments;
|
||||||
// $FlowIgnore - callee isn't optional in the type definition
|
// $FlowIgnore - callee isn't optional in the type definition
|
||||||
delete node.callee;
|
delete node.callee;
|
||||||
|
} else if (node.type === "CallExpression") {
|
||||||
|
(node: N.Node).optional = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
@ -434,4 +436,14 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parseSubscript(...args) {
|
||||||
|
const node = super.parseSubscript(...args);
|
||||||
|
|
||||||
|
if (node.type === "MemberExpression") {
|
||||||
|
node.optional = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user