committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
12
node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
12
node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
@ -33,10 +33,16 @@ const {
|
||||
} = _t;
|
||||
|
||||
function getTypeAnnotation() {
|
||||
if (this.typeAnnotation) return this.typeAnnotation;
|
||||
let type = this._getTypeAnnotation() || anyTypeAnnotation();
|
||||
let type = this.getData("typeAnnotation");
|
||||
|
||||
if (type != null) {
|
||||
return type;
|
||||
}
|
||||
|
||||
type = this._getTypeAnnotation() || anyTypeAnnotation();
|
||||
if (isTypeAnnotation(type)) type = type.typeAnnotation;
|
||||
return this.typeAnnotation = type;
|
||||
this.setData("typeAnnotation", type);
|
||||
return type;
|
||||
}
|
||||
|
||||
const typeAnnotationInferringNodes = new WeakSet();
|
||||
|
2
node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
2
node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
@ -202,5 +202,5 @@ function getConditionalAnnotation(binding, path, name) {
|
||||
};
|
||||
}
|
||||
|
||||
return getConditionalAnnotation(ifStatement, name);
|
||||
return getConditionalAnnotation(binding, ifStatement, name);
|
||||
}
|
2
node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
2
node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
@ -87,7 +87,7 @@ function TypeCastExpression(node) {
|
||||
TypeCastExpression.validParent = true;
|
||||
|
||||
function NewExpression(node) {
|
||||
if (this.get("callee").isIdentifier()) {
|
||||
if (node.callee.type === "Identifier") {
|
||||
return genericTypeAnnotation(node.callee);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user