Skip to content

Commit

Permalink
fix: create static empty node for (fixes #179)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Nov 16, 2017
1 parent 5b305a6 commit 48e450e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@
}
};

m.emptyVNode = m("#text", '');

m.flatten = function(children) {
for(var i = 0; i < children.length; ) {
var child = children[i];
Expand Down Expand Up @@ -1641,7 +1639,7 @@
var ifNode = data.ifNode;
var elseNode = data.elseNode;
var ifValue = output;
var elseValue = "m.emptyVNode";
var elseValue;
var staticNodes = state.staticNodes;

if(ifNode !== undefined) {
Expand All @@ -1652,7 +1650,9 @@
}
}

if(elseNode !== undefined) {
if(elseNode === undefined) {
elseValue = generateStaticNode("m(\"#text\", '')", staticNodes);
} else {
if(elseNode.dynamic === true) {
elseValue = elseNode.output;
} else {
Expand Down
Loading

0 comments on commit 48e450e

Please sign in to comment.