removed Function.bind() call
This commit is contained in:
parent
df39e1127f
commit
f612ce4b2c
1 changed files with 11 additions and 3 deletions
10
mithril.js
10
mithril.js
|
|
@ -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") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue