Skip to content

Commit

Permalink
fix lazy code breaks in build
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau authored and Conduitry committed Mar 5, 2020
1 parent a829122 commit 345d5f2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/compiler/compile/render_dom/wrappers/IfBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import FragmentWrapper from './Fragment';
import { b, x } from 'code-red';
import { walk } from 'estree-walker';
import { is_head } from './shared/is_head';
import { Identifier, Node } from 'estree';
import { Identifier, Node, UnaryExpression } from 'estree';

function is_else_if(node: ElseBlock) {
return (
Expand Down Expand Up @@ -591,14 +591,17 @@ export default class IfBlockWrapper extends Wrapper {
get_initial_dirty_bit() {
const _this = this;
// TODO: context-overflow make it less gross

const val = x`-1`;
const val: UnaryExpression = x`-1` as UnaryExpression;
return {
...val,
elements: [val],
get type() {
return _this.renderer.context_overflow ? 'ArrayExpression' : 'UnaryExpression';
},
// as [-1]
elements: [val],
// as -1
operator: val.operator,
prefix: val.prefix,
argument: val.argument,
};
}
}

0 comments on commit 345d5f2

Please sign in to comment.