Skip to content

Commit 98738e2

Browse files
committed
Merge pull request cocos2d#1623 from erykwalder/develop
Fix legacy Function.prototype.bind support
2 parents c45c867 + c4dc4d9 commit 98738e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cocos2d/core/platform/CCClass.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ ClassManager.compileSuper.ClassManager = ClassManager;
183183

184184
Function.prototype.bind = Function.prototype.bind || function (bind) {
185185
var self = this;
186+
var args = Array.prototype.slice.call(arguments, 1);
186187
return function () {
187-
var args = Array.prototype.slice.call(arguments);
188-
return self.apply(bind || null, args);
188+
return self.apply(bind || null, args.concat(Array.prototype.slice.call(arguments)));
189189
};
190190
};
191191

0 commit comments

Comments
 (0)