mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-15 13:17:50 +00:00
Fix bizarro setTimeout and clearTimeout for requirejs test runs.
This commit is contained in:
@@ -44,11 +44,19 @@
|
|||||||
Object._keys = Object.keys;
|
Object._keys = Object.keys;
|
||||||
Object.keys = function() {};
|
Object.keys = function() {};
|
||||||
|
|
||||||
window._clearTimeout = clearTimeout;
|
window.clearTimeout = (function(fn) {
|
||||||
window.clearTimeout = function() {};
|
window._clearTimeout = fn;
|
||||||
|
return function(id) {
|
||||||
|
return fn(id);
|
||||||
|
};
|
||||||
|
}(clearTimeout));
|
||||||
|
|
||||||
window._setTimeout = setTimeout;
|
window.setTimeout = (function(fn) {
|
||||||
window.setTimeout = function() {};
|
window._setTimeout = fn;
|
||||||
|
return function(func, wait) {
|
||||||
|
return fn(func, wait);
|
||||||
|
};
|
||||||
|
}(setTimeout));
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeBizarroMethods() {
|
function removeBizarroMethods() {
|
||||||
@@ -211,7 +219,6 @@
|
|||||||
}
|
}
|
||||||
if (window.requirejs) {
|
if (window.requirejs) {
|
||||||
addBizarroMethods();
|
addBizarroMethods();
|
||||||
|
|
||||||
require(getConfig(), ['lodash'], function(lodash) {
|
require(getConfig(), ['lodash'], function(lodash) {
|
||||||
lodashBizarro = lodash;
|
lodashBizarro = lodash;
|
||||||
delete requirejs.s.contexts._;
|
delete requirejs.s.contexts._;
|
||||||
|
|||||||
Reference in New Issue
Block a user