From a4e6567b82071e0b2f646f2417a8a0e2f6af4de3 Mon Sep 17 00:00:00 2001 From: impinball Date: Mon, 13 Jul 2015 14:53:26 -0400 Subject: [PATCH 1/3] Forgot to assign the default argument --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index d1c77cc8..0736ac4f 100644 --- a/mithril.js +++ b/mithril.js @@ -755,7 +755,7 @@ var m = (function app(window, undefined) { else if (isString(root)) { var oldRoute = currentRoute; currentRoute = root; - arg1 || {}; + arg1 = arg1 || {}; var queryIndex = currentRoute.indexOf("?"); var params = queryIndex > -1 ? parseQueryString(currentRoute.slice(queryIndex + 1)) : {}; for (var i in arg1) params[i] = arg1[i]; From a22710284e8d5a04b50335a22ef6953ce652127f Mon Sep 17 00:00:00 2001 From: impinball Date: Mon, 13 Jul 2015 15:00:10 -0400 Subject: [PATCH 2/3] Fix default assign --- mithril.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index 0736ac4f..06e14af8 100644 --- a/mithril.js +++ b/mithril.js @@ -755,10 +755,10 @@ var m = (function app(window, undefined) { else if (isString(root)) { var oldRoute = currentRoute; currentRoute = root; - arg1 = arg1 || {}; + var args = arg1 || {}; var queryIndex = currentRoute.indexOf("?"); var params = queryIndex > -1 ? parseQueryString(currentRoute.slice(queryIndex + 1)) : {}; - for (var i in arg1) params[i] = arg1[i]; + for (var i in arg1) params[i] = args[i]; var querystring = buildQueryString(params); var currentPath = queryIndex > -1 ? currentRoute.slice(0, queryIndex) : currentRoute; if (querystring) currentRoute = currentPath + (currentPath.indexOf("?") === -1 ? "?" : "&") + querystring; From fcb58429388211e2bbd4aca2addad65297cb211e Mon Sep 17 00:00:00 2001 From: impinball Date: Mon, 13 Jul 2015 15:12:25 -0400 Subject: [PATCH 3/3] Fix default assign --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 06e14af8..80f5e130 100644 --- a/mithril.js +++ b/mithril.js @@ -758,7 +758,7 @@ var m = (function app(window, undefined) { var args = arg1 || {}; var queryIndex = currentRoute.indexOf("?"); var params = queryIndex > -1 ? parseQueryString(currentRoute.slice(queryIndex + 1)) : {}; - for (var i in arg1) params[i] = args[i]; + for (var i in args) params[i] = args[i]; var querystring = buildQueryString(params); var currentPath = queryIndex > -1 ? currentRoute.slice(0, queryIndex) : currentRoute; if (querystring) currentRoute = currentPath + (currentPath.indexOf("?") === -1 ? "?" : "&") + querystring;