Skip to content

Commit 13cbd58

Browse files
committed
fix: Only enforce a value's presence in a dynamic switch condition if the condition is not disabled due to a missing style dependency.
1 parent f401217 commit 13cbd58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/glimmer-templates/src/helpers/classnames.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ function sourceExpr(stack: any[],
129129
isSourceSet: IsSourceSet, setSource: SetSource,
130130
abort: Abort
131131
): void {
132+
let enforceSwitch = true;
132133
let type = number(stack);
133134
if (type & SourceExpression.dependency) {
134135
let numDeps = number(stack);
135136
while (numDeps-- > 0) {
136137
let depIndex = number(stack);
137-
if (!isSourceSet(depIndex)) abort();
138+
if (!isSourceSet(depIndex)) enforceSwitch = abort();
138139
}
139140
}
140141
if (type & SourceExpression.boolean) {
@@ -150,7 +151,7 @@ function sourceExpr(stack: any[],
150151
value = string(stack);
151152
break;
152153
case FalsySwitchBehavior.error:
153-
e("string expected"); // TODO: error message
154+
if (enforceSwitch) e("string expected"); // TODO: error message
154155
break;
155156
case FalsySwitchBehavior.unset:
156157
abort();

0 commit comments

Comments
 (0)