[ts]Set false to default value of TsTypePredicate.asserts (#12352)

This commit is contained in:
Sosuke Suzuki 2020-11-17 00:51:27 +09:00 committed by GitHub
parent 56fd90452c
commit a4e4aede14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -357,6 +357,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
const node: N.TsTypePredicate = this.startNodeAtNode(lhs);
node.parameterName = lhs;
node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);
node.asserts = false;
return this.finishNode(node, "TSTypePredicate");
}

View File

@ -1262,7 +1262,7 @@ export type TsTypePredicate = TsTypeBase & {
type: "TSTypePredicate",
parameterName: Identifier | TsThisType,
typeAnnotation: TsTypeAnnotation,
asserts?: boolean,
asserts: boolean,
};
// `typeof` operator

View File

@ -52,7 +52,8 @@
"type": "TSStringKeyword",
"start":31,"end":37,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}}
}
}
},
"asserts": false
}
},
"body": {
@ -92,7 +93,8 @@
"type": "TSStringKeyword",
"start":66,"end":72,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":28}}
}
}
},
"asserts": false
}
},
"id": null,