Skip to content

Commit 345d5f2

Browse files
tanhauhauConduitry
authored andcommitted
fix lazy code breaks in build
1 parent a829122 commit 345d5f2

File tree

1 file changed

+8
-5
lines changed
  • src/compiler/compile/render_dom/wrappers

1 file changed

+8
-5
lines changed

src/compiler/compile/render_dom/wrappers/IfBlock.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import FragmentWrapper from './Fragment';
99
import { b, x } from 'code-red';
1010
import { walk } from 'estree-walker';
1111
import { is_head } from './shared/is_head';
12-
import { Identifier, Node } from 'estree';
12+
import { Identifier, Node, UnaryExpression } from 'estree';
1313

1414
function is_else_if(node: ElseBlock) {
1515
return (
@@ -591,14 +591,17 @@ export default class IfBlockWrapper extends Wrapper {
591591
get_initial_dirty_bit() {
592592
const _this = this;
593593
// TODO: context-overflow make it less gross
594-
595-
const val = x`-1`;
594+
const val: UnaryExpression = x`-1` as UnaryExpression;
596595
return {
597-
...val,
598-
elements: [val],
599596
get type() {
600597
return _this.renderer.context_overflow ? 'ArrayExpression' : 'UnaryExpression';
601598
},
599+
// as [-1]
600+
elements: [val],
601+
// as -1
602+
operator: val.operator,
603+
prefix: val.prefix,
604+
argument: val.argument,
602605
};
603606
}
604607
}

0 commit comments

Comments
 (0)