mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
Merge pull request #252 from pandamicro/v0.7
Fixed indexOf issue on Baidu browser, damn you baidu browser guys !
This commit is contained in:
@@ -76,7 +76,7 @@ CallbacksHandler.prototype.has = function (key, callback, target) {
|
||||
if (callbackTarget === target) {
|
||||
return true;
|
||||
}
|
||||
index = list.indexOf(callback, index + 1);
|
||||
index = cc.js.array.indexOf.call(list, callback, index + 1);
|
||||
}
|
||||
// callback given but not found
|
||||
return false;
|
||||
@@ -131,7 +131,7 @@ CallbacksHandler.prototype.remove = function (key, callback, target) {
|
||||
break;
|
||||
}
|
||||
|
||||
index = list.indexOf(callback, index + 1);
|
||||
index = cc.js.array.indexOf.call(list, callback, index + 1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -628,7 +628,9 @@ js.array = {
|
||||
for (i = 0; i < len; i += 1)
|
||||
arr_clone[i] = array[i];
|
||||
return arr_clone;
|
||||
}
|
||||
},
|
||||
|
||||
indexOf: Array.prototype.indexOf,
|
||||
};
|
||||
|
||||
cc.js = js;
|
||||
|
||||
Reference in New Issue
Block a user