Skip to content

Commit d88c935

Browse files
authored
fix: correct incorrect assertions (#4839)
1 parent 5368e80 commit d88c935

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/ast/variables/LocalVariable.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,31 @@ export default class LocalVariable extends Variable {
160160
switch (interaction.type) {
161161
case INTERACTION_ACCESSED: {
162162
if (this.isReassigned) return true;
163-
return (this.init &&
163+
return !!(
164+
this.init &&
164165
!context.accessed.trackEntityAtPathAndGetIfTracked(path, this) &&
165-
this.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;
166+
this.init.hasEffectsOnInteractionAtPath(path, interaction, context)
167+
);
166168
}
167169
case INTERACTION_ASSIGNED: {
168170
if (this.included) return true;
169171
if (path.length === 0) return false;
170172
if (this.isReassigned) return true;
171-
return (this.init &&
173+
return !!(
174+
this.init &&
172175
!context.assigned.trackEntityAtPathAndGetIfTracked(path, this) &&
173-
this.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;
176+
this.init.hasEffectsOnInteractionAtPath(path, interaction, context)
177+
);
174178
}
175179
case INTERACTION_CALLED: {
176180
if (this.isReassigned) return true;
177-
return (this.init &&
181+
return !!(
182+
this.init &&
178183
!(
179184
interaction.withNew ? context.instantiated : context.called
180185
).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) &&
181-
this.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;
186+
this.init.hasEffectsOnInteractionAtPath(path, interaction, context)
187+
);
182188
}
183189
}
184190
}

0 commit comments

Comments
 (0)