Skip to content

Commit

Permalink
fix: test due rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jodarove committed Apr 10, 2022
1 parent cfdf043 commit 81abb4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/@lwc/template-compiler/src/codegen/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ export default class CodeGen {
return expression as t.Expression;
}

genHoistedElement(element: Element): t.Expression {
genHoistedElement(element: Element, slotParentName?: string): t.Expression {
const key =
slotParentName !== undefined
? `@${slotParentName}:${this.generateKey()}`
: this.generateKey();
const html = serializeStaticElement(element);

this.usedLwcApis.add(PARSE_FRAGMENT_METHOD_NAME);
Expand Down Expand Up @@ -537,7 +541,7 @@ export default class CodeGen {
t.callExpression(t.identifier(`$hoisted${idx}`), [])
)
),
t.literal(this.generateKey()),
t.literal(key),
]);
}
}
2 changes: 1 addition & 1 deletion packages/@lwc/template-compiler/src/codegen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function transform(codeGen: CodeGen): t.Expression {
res = codeGen.getSlot(element.slotName, databag, defaultSlot);
} else {
res = codeGen.staticNodes.has(element)
? codeGen.genHoistedElement(element)
? codeGen.genHoistedElement(element, slotParentName)
: codeGen.genElement(name, databag, children);
}

Expand Down

0 comments on commit 81abb4d

Please sign in to comment.