Fixing global leak for 'timer'
This commit is contained in:
@@ -341,24 +341,4 @@ describe("Clock (acceptance)", function() {
|
||||
clock.tick();
|
||||
expect(delayedFn2).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("calls the global clearTimeout correctly when not installed", function() {
|
||||
var delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['clearTimeout']),
|
||||
global = jasmine.getGlobal(),
|
||||
clock = new j$.Clock(global, delayedFunctionScheduler);
|
||||
|
||||
expect(function() {
|
||||
clock.clearTimeout(123)
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("calls the global clearTimeout correctly when not installed", function() {
|
||||
var delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['clearTimeout']),
|
||||
global = jasmine.getGlobal(),
|
||||
clock = new j$.Clock(global, delayedFunctionScheduler);
|
||||
|
||||
expect(function() {
|
||||
clock.clearInterval(123)
|
||||
}).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,7 +13,8 @@ getJasmineRequireObj().Clock = function() {
|
||||
setInterval: setInterval,
|
||||
clearInterval: clearInterval
|
||||
},
|
||||
installed = false;
|
||||
installed = false,
|
||||
timer;
|
||||
|
||||
self.install = function() {
|
||||
replace(global, fakeTimingFunctions);
|
||||
|
||||
Reference in New Issue
Block a user