From 0fbf3a61fb24a9147fb9e214684fb9ee8615f0ff Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 10 Oct 2017 14:11:28 -0700 Subject: [PATCH] Fix new type errors (#754) --- src/parser/expression.js | 4 ++-- src/parser/location.js | 2 +- src/parser/statement.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/parser/expression.js b/src/parser/expression.js index 58776bb6f3..cfc8442f91 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -1125,7 +1125,7 @@ export default class ExpressionParser extends LValParser { refShorthandDefaultPos?: ?Pos, ): T { let decorators = []; - const propHash = Object.create(null); + const propHash: any = Object.create(null); let first = true; const node = this.startNode(); @@ -1567,7 +1567,7 @@ export default class ExpressionParser extends LValParser { } if (checkLVal) { - const nameHash = Object.create(null); + const nameHash: any = Object.create(null); const oldStrict = this.state.strict; if (isStrict) this.state.strict = true; if (node.id) { diff --git a/src/parser/location.js b/src/parser/location.js index a037632672..f3b0fb656d 100644 --- a/src/parser/location.js +++ b/src/parser/location.js @@ -1,6 +1,6 @@ // @flow -import { getLineInfo } from "../util/location"; +import { getLineInfo, type Position } from "../util/location"; import CommentsParser from "./comments"; // This function is used to raise exceptions on parse errors. It diff --git a/src/parser/statement.js b/src/parser/statement.js index ac1a9f57d9..4145d5e61f 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -487,7 +487,8 @@ export default class StatementParser extends ExpressionParser { if (this.match(tt.parenL)) { this.expect(tt.parenL); clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true, Object.create(null), "catch clause"); + const clashes: any = Object.create(null); + this.checkLVal(clause.param, true, clashes, "catch clause"); this.expect(tt.parenR); } else { this.expectPlugin("optionalCatchBinding");