From 6f9840c1bf4ee75bedb29424c870626a88d3cb1e Mon Sep 17 00:00:00 2001 From: Dylan Piercey Date: Thu, 28 Oct 2021 08:41:25 -0700 Subject: [PATCH] fix: issue with multiple gets before attrs/return --- src/util/is-at-root.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/is-at-root.ts b/src/util/is-at-root.ts index a7f1065..eb8756f 100644 --- a/src/util/is-at-root.ts +++ b/src/util/is-at-root.ts @@ -1,9 +1,12 @@ import { types as t } from "@marko/compiler"; import isCoreTag from "./is-core-tag"; -export default function isAtRoot(tag: t.NodePath) { +export default function isAtRoot(tag: t.NodePath): boolean { const parentPath = tag.parentPath.parentPath!; // Special case `` since it currently wraps it's children // which is an implementation detail. - return parentPath!.isProgram() || isCoreTag("get", parentPath); + return ( + parentPath!.isProgram() || + (isCoreTag("get", parentPath) && isAtRoot(parentPath)) + ); }