Skip to content

Commit

Permalink
use finishToken instead of finishNode
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Apr 24, 2019
1 parent e64cbdf commit aa3982b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/babel-parser/src/plugins/flow.js
Expand Up @@ -95,18 +95,13 @@ export default (superClass: Class<Parser>): Class<Parser> =>
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
}

finishNodeAt<T: N.Node>(
node: T,
type: string,
pos: number,
loc: Position,
): T {
if (type !== "StringLiteral") {
finishToken(type: TokenType, val: any): void {
if (!(type === tt.string || type === tt.semi)) {
if (this.flowPragma === undefined) {
this.flowPragma = null;
}
}
return super.finishNodeAt(node, type, pos, loc);
return super.finishToken(type, val);
}

addComment(comment: N.Comment): void {
Expand Down

0 comments on commit aa3982b

Please sign in to comment.