From 4f2505c0aa41497bb388b7725eddebc0ed8e7ad5 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 19 Nov 2020 10:09:40 -0500 Subject: [PATCH] Ensure `loc` is populated by `builders.element(...)` Fixes issues with AST transforms that were previously not passing `loc` in the `builders.element` options. (cherry picked from commit 48b1cbb2635ea249bef7880c94336846cb6cc048) --- packages/@glimmer/syntax/lib/v1/public-builders.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@glimmer/syntax/lib/v1/public-builders.ts b/packages/@glimmer/syntax/lib/v1/public-builders.ts index 9eb73764da..c0637d7eff 100644 --- a/packages/@glimmer/syntax/lib/v1/public-builders.ts +++ b/packages/@glimmer/syntax/lib/v1/public-builders.ts @@ -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 { @@ -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), }; }