Skip to content

Commit

Permalink
pref: don't emit event lnlayhint when content is none (#4776)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gehbt authored Sep 1, 2024
1 parent 836a606 commit b809d01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/language-core/lib/codegen/template/elementEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ export function* generateEventExpression(

export function isCompoundExpression(ts: typeof import('typescript'), ast: ts.SourceFile) {
let result = true;
if (ast.statements.length === 1) {
if (ast.statements.length === 0) {
result = false;
} else if (ast.statements.length === 1) {
ts.forEachChild(ast, child_1 => {
if (ts.isExpressionStatement(child_1)) {
ts.forEachChild(child_1, child_2 => {
Expand Down
4 changes: 2 additions & 2 deletions packages/language-core/lib/codegen/template/elementProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function* generateElementProps(
)
),
`: (`,
...genereatePropExp(
...generatePropExp(
options,
ctx,
prop,
Expand Down Expand Up @@ -290,7 +290,7 @@ export function* generateElementProps(
}
}

function* genereatePropExp(
function* generatePropExp(
options: TemplateCodegenOptions,
ctx: TemplateCodegenContext,
prop: CompilerDOM.DirectiveNode,
Expand Down

0 comments on commit b809d01

Please sign in to comment.