Merge pull request #227 from claydotio/next

removed Function.bind() call
This commit is contained in:
Leo Horie 2014-08-26 19:36:11 -04:00
commit 4d79d91c57

View file

@ -196,7 +196,15 @@ Mithril = m = new function app(window, undefined) {
} }
//schedule configs to be called. They are called after `build` finishes running //schedule configs to be called. They are called after `build` finishes running
if (typeof data.attrs["config"] === "function") { if (typeof data.attrs["config"] === "function") {
configs.push(data.attrs["config"].bind(window, node, !isNew, cached.configContext = cached.configContext || {}, cached)) var context = cached.configContext = cached.configContext || {}
// bind
configs.push((function (data, node, isNew, context, cached) {
var args = [node, !isNew, context, cached]
return function () {
return data.attrs["config"].apply(data, args.concat(Array.prototype.slice.call(arguments, 0)))
}
})(data, node, isNew, context, cached))
} }
} }
else if (typeof dataType != "function") { else if (typeof dataType != "function") {