From 749adf329b928e7ec414ad19702de0e224ede97b Mon Sep 17 00:00:00 2001 From: Kabir Shah Date: Thu, 13 Jun 2019 15:08:04 -0700 Subject: [PATCH] remove wrong map in empty loop --- packages/moon/dist/moon.js | 8 ++++++-- packages/moon/dist/moon.min.js | 2 +- packages/moon/src/executor/executor.js | 8 ++++++-- packages/moon/test/performance/list.js | 4 +++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/moon/dist/moon.js b/packages/moon/dist/moon.js index 9ebf10b9..551160c5 100644 --- a/packages/moon/dist/moon.js +++ b/packages/moon/dist/moon.js @@ -1237,8 +1237,12 @@ } // Execute the views of the children. - for (var i = 0; i < nodeChildren.length; i++) { - nodes.push(nodeChildren[i]); + var nodeChildrenLength = nodeChildren.length; + + if (nodeChildrenLength !== 0) { + for (var i = 0; i < nodeChildrenLength; i++) { + nodes.push(nodeChildren[i]); + } } if (nodes.length === 0) { diff --git a/packages/moon/dist/moon.min.js b/packages/moon/dist/moon.min.js index 775aaf37..f87be9db 100644 --- a/packages/moon/dist/moon.min.js +++ b/packages/moon/dist/moon.min.js @@ -4,4 +4,4 @@ * Released under the MIT License * https://kbrsh.github.io/moon */ -!function(e,t){"undefined"==typeof module?e.Moon=t():module.exports=t()}(this,function(){"use strict";var O={element:0,text:1,component:2};function f(e,t,a){this.node=e,this.element=t,this.children=a}function v(e,t,a,n){this.type=e,this.name=t,this.data=a,this.children=n}function L(e,t){return void 0===e?t:e}function l(e,t,a,n){return new v(e,t,a,n)}var c,d,o,M=/^\s+$/,q=/<([\w\d-_]+)([^>]*?)(\/?)>/g,t=/"[^"]*"|'[^']*'|\d+[a-zA-Z$_]\w*|\.[a-zA-Z$_]\w*|[a-zA-Z$_]\w*:|([a-zA-Z$_]\w*)/g,E=/&|>|<| |"|\\|"|\n|\r/g,n=["NaN","false","in","null","this","true","typeof","undefined","window"],N={class:"className",for:"htmlFor"},$={"&":"&",">":">","<":"<"," ":" ",""":'\\"',"\\":"\\\\",'"':'\\"',"\n":"\\n","\r":"\\r"};function D(e){var a=!0;return{value:e.replace(t,function(e,t){return void 0===t||-1!==n.indexOf(t)?e:(a=!1,"$"===t[0]?t:"md."+t)}),isStatic:a}}function a(e){e=e.trim();for(var t=[],a=0;a",a+2),s=e.slice(a+2,i);0,t.push({type:"tagClose",value:s}),a=i+1;continue}if("!"===r&&"-"===e[a+2]&&"-"===e[a+3]){var l=e.indexOf("--\x3e",a+4);0,a=l+3;continue}q.lastIndex=a;var o=q.exec(e);0;for(var u=o[0],v=o[1],f=o[2],c=o[3],d={},h=0;h]*?)(\/?)>/g,t=/"[^"]*"|'[^']*'|\d+[a-zA-Z$_]\w*|\.[a-zA-Z$_]\w*|[a-zA-Z$_]\w*:|([a-zA-Z$_]\w*)/g,E=/&|>|<| |"|\\|"|\n|\r/g,n=["NaN","false","in","null","this","true","typeof","undefined","window"],N={class:"className",for:"htmlFor"},$={"&":"&",">":">","<":"<"," ":" ",""":'\\"',"\\":"\\\\",'"':'\\"',"\n":"\\n","\r":"\\r"};function D(e){var a=!0;return{value:e.replace(t,function(e,t){return void 0===t||-1!==n.indexOf(t)?e:(a=!1,"$"===t[0]?t:"md."+t)}),isStatic:a}}function a(e){e=e.trim();for(var t=[],a=0;a",a+2),s=e.slice(a+2,i);0,t.push({type:"tagClose",value:s}),a=i+1;continue}if("!"===r&&"-"===e[a+2]&&"-"===e[a+3]){var l=e.indexOf("--\x3e",a+4);0,a=l+3;continue}q.lastIndex=a;var o=q.exec(e);0;for(var u=o[0],v=o[1],f=o[2],c=o[3],d={},h=0;h