diff --git a/mithril.js b/mithril.js index 3de1950e..7bab017d 100644 --- a/mithril.js +++ b/mithril.js @@ -1043,7 +1043,7 @@ var _11 = function($window, throttleMock) { function sync() { if (rendering) throw new Error("Nested m.redraw.sync() call") rendering = true - for (var i = 1; i < callbacks.length; i+=2) try {callbacks[i]()} catch (e) {console.error(e)} + for (var i = 1; i < callbacks.length; i+=2) try {callbacks[i]()} catch (e) {if (typeof console !== "undefined") console.error(e)} rendering = false } var redraw = (throttleMock || throttle)(sync) diff --git a/mithril.min.js b/mithril.min.js index 142c3037..0885ab90 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -34,12 +34,12 @@ a.dom.value===g&&a.dom===t.activeElement)return;if("select"===a.tag)if(null===d) a||"onbeforeremove"===a||"onbeforeupdate"===a}function H(){}function A(a,c,b){null!=a.events?a.events[c]!==b&&(null==b||"function"!==typeof b&&"object"!==typeof b?(null!=a.events[c]&&a.dom.removeEventListener(c.slice(2),a.events,!1),a.events[c]=void 0):(null==a.events[c]&&a.dom.addEventListener(c.slice(2),a.events,!1),a.events[c]=b)):null==b||"function"!==typeof b&&"object"!==typeof b||(a.events=new H,a.dom.addEventListener(c.slice(2),a.events,!1),a.events[c]=b)}function I(a,c,b){"function"===typeof a.oninit&& a.oninit.call(c.state,c);"function"===typeof a.oncreate&&b.push(a.oncreate.bind(c.state,c))}function K(a,c,b){"function"===typeof a.onupdate&&b.push(a.onupdate.bind(c.state,c))}var t=b.document,L=t.createDocumentFragment(),G={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},E;H.prototype=Object.create(null);H.prototype.handleEvent=function(a){var c=this["on"+a.type];"function"===typeof c?c.call(a.target,a):"function"===typeof c.handleEvent&&c.handleEvent(a);"function"=== typeof E&&E.call(a.target,a)};return{render:function(a,c){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var b=[],d=t.activeElement,f=a.namespaceURI;null==a.vnodes&&(a.textContent="");Array.isArray(c)||(c=[c]);m(a,a.vnodes,y.normalizeChildren(c),!1,b,null,"http://www.w3.org/1999/xhtml"===f?void 0:f);a.vnodes=c;for(f=0;f