Skip to content

Commit

Permalink
nit: ensure end is assigned after start
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Apr 30, 2021
1 parent 0d2cffa commit 6c0bcd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-parser/src/parser/node.js
Expand Up @@ -10,14 +10,15 @@ import type { Comment, Node as NodeType, NodeBase } from "../types";
class Node implements NodeBase {
constructor(parser: Parser, pos: number, loc: Position) {
this.start = pos;
this.end = 0;
this.loc = new SourceLocation(loc);
if (parser?.options.ranges) this.range = [pos, 0];
if (parser?.filename) this.loc.filename = parser.filename;
}

type: string = "";
declare start: number;
end: number = 0;
declare end: number;
loc: SourceLocation;
declare range: [number, number];
declare leadingComments: Array<Comment>;
Expand Down

0 comments on commit 6c0bcd4

Please sign in to comment.