From 243ff8019603345b3abc869159ac072d4291847d Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Thu, 24 Oct 2013 17:16:57 -0700 Subject: [PATCH] Fixing global leak for 'timer' --- spec/core/ClockSpec.js | 20 -------------------- src/core/Clock.js | 3 ++- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/spec/core/ClockSpec.js b/spec/core/ClockSpec.js index c49a25b7..168e17b5 100644 --- a/spec/core/ClockSpec.js +++ b/spec/core/ClockSpec.js @@ -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(); - }); }); diff --git a/src/core/Clock.js b/src/core/Clock.js index 029bf5c4..fab0fd7a 100644 --- a/src/core/Clock.js +++ b/src/core/Clock.js @@ -13,7 +13,8 @@ getJasmineRequireObj().Clock = function() { setInterval: setInterval, clearInterval: clearInterval }, - installed = false; + installed = false, + timer; self.install = function() { replace(global, fakeTimingFunctions);