Make asserts property boolean, not undefined (#12167)
This commit is contained in:
parent
d49e5507ae
commit
a5bed04f55
@ -1039,7 +1039,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
const t: N.TsTypeAnnotation = this.startNode();
|
const t: N.TsTypeAnnotation = this.startNode();
|
||||||
this.expect(returnToken);
|
this.expect(returnToken);
|
||||||
|
|
||||||
const asserts = this.tsTryParse(
|
const asserts = !!this.tsTryParse(
|
||||||
this.tsParseTypePredicateAsserts.bind(this),
|
this.tsParseTypePredicateAsserts.bind(this),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,8 @@
|
|||||||
"type": "TSStringKeyword",
|
"type": "TSStringKeyword",
|
||||||
"start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}
|
"start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"asserts": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"id": null,
|
"id": null,
|
||||||
|
|||||||
@ -50,7 +50,8 @@
|
|||||||
"type": "TSBooleanKeyword",
|
"type": "TSBooleanKeyword",
|
||||||
"start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}}
|
"start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"asserts": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"body": {
|
"body": {
|
||||||
@ -66,6 +67,10 @@
|
|||||||
"expression": {
|
"expression": {
|
||||||
"type": "FunctionExpression",
|
"type": "FunctionExpression",
|
||||||
"start":37,"end":70,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":34}},
|
"start":37,"end":70,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":34}},
|
||||||
|
"extra": {
|
||||||
|
"parenthesized": true,
|
||||||
|
"parenStart": 36
|
||||||
|
},
|
||||||
"id": null,
|
"id": null,
|
||||||
"generator": false,
|
"generator": false,
|
||||||
"async": false,
|
"async": false,
|
||||||
@ -102,7 +107,8 @@
|
|||||||
"type": "TSBooleanKeyword",
|
"type": "TSBooleanKeyword",
|
||||||
"start":60,"end":67,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}}
|
"start":60,"end":67,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"asserts": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"body": {
|
"body": {
|
||||||
@ -110,10 +116,6 @@
|
|||||||
"start":68,"end":70,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":34}},
|
"start":68,"end":70,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":34}},
|
||||||
"body": [],
|
"body": [],
|
||||||
"directives": []
|
"directives": []
|
||||||
},
|
|
||||||
"extra": {
|
|
||||||
"parenthesized": true,
|
|
||||||
"parenStart": 36
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user