Fix range on TypeScript index signature parameters (#9335)

This commit is contained in:
Brian Ng
2019-01-15 06:52:33 -06:00
committed by GitHub
parent e8038863c3
commit 34c9890f41
4 changed files with 19 additions and 18 deletions

View File

@@ -398,8 +398,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
this.expect(tt.bracketL);
const id = this.parseIdentifier();
this.expect(tt.colon);
id.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);
id.typeAnnotation = this.tsParseTypeAnnotation();
this.finishNode(id, "Identifier"); // set end position to end of type
this.expect(tt.bracketR);
node.parameters = [id];