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)) + ); }