Merge remote-tracking branch 'origin/rewrite' into rewrite

This commit is contained in:
Leo 2017-01-23 18:03:51 -05:00
commit c160daeaab
4 changed files with 5 additions and 5 deletions

View file

@ -154,7 +154,7 @@ var Fader = {
### onremove ### onremove
The `onremove(vnode)` hook is called before a DOM element is removed from the document. If a `onbeforeremove` hook is also defined, the `onremove` hook runs after the `done` callback is called. The `onremove(vnode)` hook is called before a DOM element is removed from the document. If a `onbeforeremove` hook is also defined, the `onremove` hook runs after the promise returned from `onbeforeremove` is completed.
This hook is called on any element that is removed from the document, regardless of whether it was directly detached from its parent or whether it is a child of another element that was detached. This hook is called on any element that is removed from the document, regardless of whether it was directly detached from its parent or whether it is a child of another element that was detached.

View file

@ -17,7 +17,7 @@ Vnode.normalizeChildren = function normalizeChildren(children) {
var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
var selectorCache = {} var selectorCache = {}
function hyperscript(selector) { function hyperscript(selector) {
if (selector == null || typeof selector !== "string" && selector.view == null) { if (selector == null || typeof selector !== "string" && typeof selector.view !== "function") {
throw Error("The selector must be either a string or a component."); throw Error("The selector must be either a string or a component.");
} }
if (typeof selector === "string" && selectorCache[selector] === undefined) { if (typeof selector === "string" && selectorCache[selector] === undefined) {

4
mithril.min.js vendored
View file

@ -1,5 +1,5 @@
new function(){function u(a,c,m,d,h,n){return{tag:a,key:c,attrs:m,children:d,text:h,dom:n,domSize:void 0,state:{},events:void 0,instance:void 0,skip:!1}}function B(a){if(null==a||"string"!==typeof a&&null==a.view)throw Error("The selector must be either a string or a component.");if("string"===typeof a&&void 0===G[a]){for(var c,m,d=[],h={};c=N.exec(a);){var n=c[1],q=c[2];""===n&&""!==q?m=q:"#"===n?h.id=q:"."===n?d.push(q):"["===c[3][0]&&((n=c[6])&&(n=n.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")), new function(){function u(a,c,m,d,h,n){return{tag:a,key:c,attrs:m,children:d,text:h,dom:n,domSize:void 0,state:{},events:void 0,instance:void 0,skip:!1}}function B(a){if(null==a||"string"!==typeof a&&"function"!==typeof a.view)throw Error("The selector must be either a string or a component.");if("string"===typeof a&&void 0===G[a]){for(var c,m,d=[],h={};c=N.exec(a);){var n=c[1],q=c[2];""===n&&""!==q?m=q:"#"===n?h.id=q:"."===n?d.push(q):"["===c[3][0]&&((n=c[6])&&(n=n.replace(/\\(["'])/g,"$1").replace(/\\\\/g,
"class"===c[4]?d.push(n):h[c[4]]=n||!0)}0<d.length&&(h.className=d.join(" "));G[a]=function(a,c){var k=!1,b,p,d=a.className||a["class"],n;for(n in h)a[n]=h[n];void 0!==d&&(void 0!==a["class"]&&(a["class"]=void 0,a.className=d),void 0!==h.className&&(a.className=h.className+" "+d));for(n in a)if("key"!==n){k=!0;break}Array.isArray(c)&&1==c.length&&null!=c[0]&&"#"===c[0].tag?p=c[0].children:b=c;return u(m||"div",a.key,k?a:void 0,b,p,void 0)}}var p;null==arguments[1]||"object"===typeof arguments[1]&& "\\")),"class"===c[4]?d.push(n):h[c[4]]=n||!0)}0<d.length&&(h.className=d.join(" "));G[a]=function(a,c){var k=!1,b,p,d=a.className||a["class"],n;for(n in h)a[n]=h[n];void 0!==d&&(void 0!==a["class"]&&(a["class"]=void 0,a.className=d),void 0!==h.className&&(a.className=h.className+" "+d));for(n in a)if("key"!==n){k=!0;break}Array.isArray(c)&&1==c.length&&null!=c[0]&&"#"===c[0].tag?p=c[0].children:b=c;return u(m||"div",a.key,k?a:void 0,b,p,void 0)}}var p;null==arguments[1]||"object"===typeof arguments[1]&&
void 0===arguments[1].tag&&!Array.isArray(arguments[1])?(p=arguments[1],d=2):d=1;if(arguments.length===d+1)c=Array.isArray(arguments[d])?arguments[d]:[arguments[d]];else for(c=[];d<arguments.length;d++)c.push(arguments[d]);return"string"===typeof a?G[a](p||{},u.normalizeChildren(c)):u(a,p&&p.key,p||{},u.normalizeChildren(c),void 0,void 0)}function O(a){var c=0,m=null,d="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var h=Date.now();0===c||16<=h-c?(c=h, void 0===arguments[1].tag&&!Array.isArray(arguments[1])?(p=arguments[1],d=2):d=1;if(arguments.length===d+1)c=Array.isArray(arguments[d])?arguments[d]:[arguments[d]];else for(c=[];d<arguments.length;d++)c.push(arguments[d]);return"string"===typeof a?G[a](p||{},u.normalizeChildren(c)):u(a,p&&p.key,p||{},u.normalizeChildren(c),void 0,void 0)}function O(a){var c=0,m=null,d="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var h=Date.now();0===c||16<=h-c?(c=h,
a()):null===m&&(m=d(function(){m=null;a();c=Date.now()},16-(h-c)))}}u.normalize=function(a){return Array.isArray(a)?u("[",void 0,void 0,u.normalizeChildren(a),void 0,void 0):null!=a&&"object"!==typeof a?u("#",void 0,void 0,!1===a?"":a,void 0,void 0):a};u.normalizeChildren=function(a){for(var c=0;c<a.length;c++)a[c]=u.normalize(a[c]);return a};var N=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,G={};B.trust=function(a){null==a&&(a="");return u("<",void 0,void 0,a,void 0, a()):null===m&&(m=d(function(){m=null;a();c=Date.now()},16-(h-c)))}}u.normalize=function(a){return Array.isArray(a)?u("[",void 0,void 0,u.normalizeChildren(a),void 0,void 0):null!=a&&"object"!==typeof a?u("#",void 0,void 0,!1===a?"":a,void 0,void 0):a};u.normalizeChildren=function(a){for(var c=0;c<a.length;c++)a[c]=u.normalize(a[c]);return a};var N=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,G={};B.trust=function(a){null==a&&(a="");return u("<",void 0,void 0,a,void 0,
void 0)};B.fragment=function(a,c){return u("[",a.key,a,u.normalizeChildren(c),void 0,void 0)};var v=function(a){function c(a,b){return function C(c){var q;try{if(!b||null==c||"object"!==typeof c&&"function"!==typeof c||"function"!==typeof(q=c.then))l(function(){b||0!==a.length||console.error("Possible unhandled promise rejection:",c);for(var d=0;d<a.length;d++)a[d](c);h.length=0;n.length=0;k.state=b;k.retry=function(){C(c)}});else{if(c===d)throw new TypeError("Promise can't be resolved w/ itself"); void 0)};B.fragment=function(a,c){return u("[",a.key,a,u.normalizeChildren(c),void 0,void 0)};var v=function(a){function c(a,b){return function C(c){var q;try{if(!b||null==c||"object"!==typeof c&&"function"!==typeof c||"function"!==typeof(q=c.then))l(function(){b||0!==a.length||console.error("Possible unhandled promise rejection:",c);for(var d=0;d<a.length;d++)a[d](c);h.length=0;n.length=0;k.state=b;k.retry=function(){C(c)}});else{if(c===d)throw new TypeError("Promise can't be resolved w/ itself");

View file

@ -5,7 +5,7 @@ var Vnode = require("../render/vnode")
var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
var selectorCache = {} var selectorCache = {}
function hyperscript(selector) { function hyperscript(selector) {
if (selector == null || typeof selector !== "string" && selector.view == null) { if (selector == null || typeof selector !== "string" && typeof selector.view !== "function") {
throw Error("The selector must be either a string or a component."); throw Error("The selector must be either a string or a component.");
} }