fix a broken Function.prototype.bind() (Closes #876)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4078 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-08-28 18:31:18 +00:00
parent a84e511c1f
commit f2ea9b4afa
2 changed files with 14 additions and 6 deletions

View File

@@ -167,10 +167,15 @@ Function.prototype.bind = function() {
}
return function(moreargs) {
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
var i;
var newArgs = [];
for (i = 0; i < args.length; i++) {
newArgs.push(args[i]);
}
return __method.apply(object, args);
for (i = 0; i < arguments.length; i++) {
newArgs.push(arguments[i]);
}
return __method.apply(object, newArgs);
};
};