Ensure __bindData__ is properly cloned. [closes #408]

This commit is contained in:
John-David Dalton
2013-11-29 06:31:37 -06:00
parent eaf1304eda
commit 7712765c3a
6 changed files with 41 additions and 11 deletions

View File

@@ -1703,8 +1703,14 @@
}
var bindData = func && func.__bindData__;
if (bindData && bindData !== true) {
// clone `bindData`
bindData = bindData.slice();
if (bindData[2]) {
bindData[2] = bindData[2].slice();
}
if (bindData[3]) {
bindData[3] = bindData[3].slice();
}
// set `thisBinding` is not previously bound
if (isBind && !(bindData[1] & 1)) {
bindData[4] = thisArg;