mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17: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)) {
|
if (!(isRhino && isModularize)) {
|
||||||
var args,
|
var args,
|
||||||
count = 0,
|
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,
|
slice = Array.prototype.slice,
|
||||||
timer = new java.util.Timer;
|
timer = new java.util.Timer;
|
||||||
|
|
||||||
context.clearInterval =
|
(function() {
|
||||||
context.clearTimeout = clearTimer;
|
var getDescriptor = Object.getOwnPropertyDescriptor || function() {
|
||||||
context.setInterval = setInterval;
|
return { 'writable': true };
|
||||||
context.setTimeout = setTimeout;
|
};
|
||||||
|
|
||||||
|
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) { }
|
} catch(e) { }
|
||||||
|
|
||||||
// expose shortcuts
|
// expose shortcuts
|
||||||
|
|||||||
Reference in New Issue
Block a user