Skip to content

Commit 40afcc1

Browse files
committed
may as well add special handling for undefined while we're here
1 parent 253807a commit 40afcc1

File tree

1 file changed

+5
-1
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared

1 file changed

+5
-1
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ export function build_template_chunk(
105105
if (node.expression.value != null) {
106106
quasi.value.cooked += node.expression.value + '';
107107
}
108-
} else {
108+
} else if (
109+
node.expression.type !== 'Identifier' ||
110+
node.expression.name !== 'undefined' ||
111+
state.scope.get('undefined')
112+
) {
109113
let value = memoize(
110114
/** @type {Expression} */ (visit(node.expression, state)),
111115
node.metadata.expression

0 commit comments

Comments
 (0)