Skip to content

Commit

Permalink
fix flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Mar 2, 2020
1 parent 95cffd7 commit 4cda1b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/babel-parser/src/parser/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default class LocationParser extends CommentsParser {

raiseWithData(
pos: number,
data: {
data?: {
missingPlugin?: Array<string>,
code?: string,
},
Expand All @@ -226,6 +226,7 @@ export default class LocationParser extends CommentsParser {
` (${loc.line}:${loc.column})`;
return this._raise(
Object.assign(
{},
{
loc,
pos,
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/parser/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ export default class StatementParser extends ExpressionParser {
// export async;
if (!this.isUnparsedContextual(next, "function")) {
this.unexpected(next, { label: "function" });
this.unexpected(next, tt._function);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/util/class-scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ClassScope {
undefinedPrivateNames: Map<string, number> = new Map();
}

type raiseFunction = (number, string) => void;
type raiseFunction = (number, string, ...any) => void;

export default class ClassScopeHandler {
stack: Array<ClassScope> = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/util/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Scope {
}
}

type raiseFunction = (number, string) => void;
type raiseFunction = (number, string, ...any) => void;

// The functions in this module keep track of declared variables in the
// current scope in order to detect duplicate variable names.
Expand Down

0 comments on commit 4cda1b5

Please sign in to comment.