Skip to content

Commit

Permalink
fix: use wrapWith
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Nov 1, 2024
1 parent ea0c358 commit 3b20821
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,22 @@ function* generateComponentGeneric(
props: (CompilerDOM.AttributeNode | CompilerDOM.DirectiveNode)[]
): Generator<Code> {
for (const prop of props) {
if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE || prop.name !== 'generic') {
if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE || prop.name !== 'generic' || !prop.exp) {
continue;
}
yield `<`;
if (prop.exp) {
yield [
yield* wrapWith(
prop.exp.loc.start.offset,
prop.exp.loc.end.offset,
ctx.codeFeatures.verification,
`<`,
[
prop.exp.loc.source,
'template',
prop.exp.loc.start.offset,
ctx.codeFeatures.all
]
}
yield `>`;
],
`>`
);
break;
}
}
Expand Down

0 comments on commit 3b20821

Please sign in to comment.