default timeout'd scope is null / global. Fixes #484

This commit is contained in:
Jeremy Ashkenas
2012-04-02 16:11:51 -04:00
parent b52908f78f
commit 1366d90333

View File

@@ -519,7 +519,7 @@
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(func, args); }, wait);
return setTimeout(function(){ return func.apply(null, args); }, wait);
};
// Defers a function, scheduling it to run after the current call stack has