mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Update qunit-clib to avoid issues with non-writable context.clearTimeout.
This commit is contained in:
@@ -1531,7 +1531,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
asyncTest('should call `trailing` with the correct `arguments` and `this` binding', 2, function() {
|
||||
asyncTest('should execute the `trailing` call with the correct arguments and `this` binding', 2, function() {
|
||||
if (!(isRhino && isModularize)) {
|
||||
var args,
|
||||
count = 0,
|
||||
|
||||
21
vendor/qunit-clib/qunit-clib.js
vendored
21
vendor/qunit-clib/qunit-clib.js
vendored
@@ -309,10 +309,23 @@
|
||||
slice = Array.prototype.slice,
|
||||
timer = new java.util.Timer;
|
||||
|
||||
context.clearInterval =
|
||||
context.clearTimeout = clearTimer;
|
||||
context.setInterval = setInterval;
|
||||
context.setTimeout = setTimeout;
|
||||
(function() {
|
||||
var getDescriptor = Object.getOwnPropertyDescriptor || function() {
|
||||
return { 'writable': true };
|
||||
};
|
||||
|
||||
var descriptor;
|
||||
if ((!context.clearInterval || ((descriptor = getDescriptor(context, 'clearInterval')) && (descriptor.writable || descriptor.set))) &&
|
||||
(!context.setInterval || ((descriptor = getDescriptor(context, 'setInterval')) && (descriptor.writable || descriptor.set)))) {
|
||||
context.clearInterval = clearTimer;
|
||||
context.setInterval = setInterval;
|
||||
}
|
||||
if ((!context.clearTimeout || ((descriptor = getDescriptor(context, 'clearTimeout')) && (descriptor.writable || descriptor.set))) &&
|
||||
(!context.setTimeout || ((descriptor = getDescriptor(context, 'setTimeout')) && (descriptor.writable || descriptor.set)))) {
|
||||
context.clearTimeout = clearTimer;
|
||||
context.setTimeout = setTimeout;
|
||||
}
|
||||
}());
|
||||
} catch(e) { }
|
||||
|
||||
// expose shortcuts
|
||||
|
||||
Reference in New Issue
Block a user