From 2dbf7b9f0c0f3c60f516d60e416f65459803c2fc Mon Sep 17 00:00:00 2001 From: Christopher Venning Date: Mon, 15 Jun 2015 17:19:35 -0400 Subject: [PATCH] Stop subsequent redraws appending arguments to parameterized components --- mithril.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index cd79c442..317f9cdf 100644 --- a/mithril.js +++ b/mithril.js @@ -558,8 +558,8 @@ var m = (function app(window, undefined) { return (component.controller || noop).apply(this, args) || this } var view = function(ctrl) { - if (arguments.length > 1) args = args.concat([].slice.call(arguments, 1)) - return component.view.apply(component, args ? [ctrl].concat(args) : [ctrl]) + var currentArgs = arguments.length > 1 ? args.concat([].slice.call(arguments, 1)) : args + return component.view.apply(component, currentArgs ? [ctrl].concat(currentArgs) : [ctrl]) } view.$original = component.view var output = {controller: controller, view: view}