Skip to content

Commit

Permalink
Ensure loc is populated by builders.element(...)
Browse files Browse the repository at this point in the history
Fixes issues with AST transforms that were previously not
passing `loc` in the `builders.element` options.

(cherry picked from commit 48b1cbb)
  • Loading branch information
rwjblue committed Nov 20, 2020
1 parent 32b59ec commit 4f2505c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@glimmer/syntax/lib/v1/public-builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export interface BuildElementOptions {
children?: ASTv1.Statement[];
comments?: ElementComment[];
blockParams?: string[];
loc: SourceSpan;
loc?: SourceSpan;
}

function buildElement(tag: TagDescriptor, options: BuildElementOptions): ASTv1.ElementNode {
Expand Down Expand Up @@ -228,7 +228,7 @@ function buildElement(tag: TagDescriptor, options: BuildElementOptions): ASTv1.E
modifiers: modifiers || [],
comments: (comments as ASTv1.MustacheCommentStatement[]) || [],
children: children || [],
loc,
loc: buildLoc(loc || null),
};
}

Expand Down

0 comments on commit 4f2505c

Please sign in to comment.