Skip to content

Commit

Permalink
fix flow error
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jan 30, 2021
1 parent 38a7717 commit afbcc32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/babel-parser/src/parser/error.js
Expand Up @@ -16,6 +16,8 @@ type ErrorContext = {
code?: string,
};

export type ParsingError = SyntaxError & ErrorContext;

export { ErrorMessages as Errors } from "./error-message.js";

export default class ParserError extends CommentsParser {
Expand Down
3 changes: 2 additions & 1 deletion packages/babel-parser/src/tokenizer/state.js
Expand Up @@ -6,6 +6,7 @@ import { Position } from "../util/location";

import { types as ct, type TokContext } from "./context";
import { types as tt, type TokenType } from "./types";
import type { ParsingError } from "../parser/error";

type TopicContextState = {
// When a topic binding has been currently established,
Expand Down Expand Up @@ -37,7 +38,7 @@ export default class State {
this.startLoc = this.endLoc = this.curPosition();
}

errors: SyntaxError[] = [];
errors: ParsingError[] = [];

// Used to signify the start of a potential arrow function
potentialArrowAt: number = -1;
Expand Down

0 comments on commit afbcc32

Please sign in to comment.