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();
|
||||
this.expect(returnToken);
|
||||
|
||||
const asserts = this.tsTryParse(
|
||||
const asserts = !!this.tsTryParse(
|
||||
this.tsParseTypePredicateAsserts.bind(this),
|
||||
);
|
||||
|
||||
|
||||
@ -31,7 +31,8 @@
|
||||
"type": "TSStringKeyword",
|
||||
"start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}
|
||||
}
|
||||
}
|
||||
},
|
||||
"asserts": false
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
|
||||
@ -50,7 +50,8 @@
|
||||
"type": "TSBooleanKeyword",
|
||||
"start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}}
|
||||
}
|
||||
}
|
||||
},
|
||||
"asserts": false
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
@ -66,6 +67,10 @@
|
||||
"expression": {
|
||||
"type": "FunctionExpression",
|
||||
"start":37,"end":70,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":34}},
|
||||
"extra": {
|
||||
"parenthesized": true,
|
||||
"parenStart": 36
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"async": false,
|
||||
@ -102,7 +107,8 @@
|
||||
"type": "TSBooleanKeyword",
|
||||
"start":60,"end":67,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}}
|
||||
}
|
||||
}
|
||||
},
|
||||
"asserts": false
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
@ -110,10 +116,6 @@
|
||||
"start":68,"end":70,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":34}},
|
||||
"body": [],
|
||||
"directives": []
|
||||
},
|
||||
"extra": {
|
||||
"parenthesized": true,
|
||||
"parenStart": 36
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user