From d528beb476f00a00786a7635270f2ec215573995 Mon Sep 17 00:00:00 2001 From: Ryunosuke SATO Date: Tue, 9 Feb 2016 02:26:26 +0900 Subject: [PATCH 1/2] [BUGFIX beta] Update backburner.js Compare view: https://github.com/ebryn/backburner.js/compare/22a4df33f23c40257bc49972e5833038452ded2e...325a969dbc7eae42dc1edfbf0ae9fb83923df5a6 --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 8730a5fa345..4ade946bfe7 100644 --- a/bower.json +++ b/bower.json @@ -10,7 +10,7 @@ "qunit-phantom-runner": "jonkemp/qunit-phantomjs-runner#1.2.0" }, "devDependencies": { - "backburner": "https://github.com/ebryn/backburner.js.git#22a4df33f23c40257bc49972e5833038452ded2e", + "backburner": "https://github.com/ebryn/backburner.js.git#325a969dbc7eae42dc1edfbf0ae9fb83923df5a6", "rsvp": "https://github.com/tildeio/rsvp.js.git#3.0.20", "router.js": "https://github.com/tildeio/router.js.git#ed45bc5c5e055af0ab875ef2c52feda792ee23e4", "dag-map": "https://github.com/krisselden/dag-map.git#1.0.2", From a168d4480d3912db11a620d57f14bea987d2a0f3 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Tue, 9 Feb 2016 21:07:30 -0500 Subject: [PATCH 2/2] [BUGFIX beta] Avoid modifying setTimeout in run.later tests. --- .../ember-metal/tests/run_loop/later_test.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/ember-metal/tests/run_loop/later_test.js b/packages/ember-metal/tests/run_loop/later_test.js index ae5f9bd09ea..a62104d82cc 100644 --- a/packages/ember-metal/tests/run_loop/later_test.js +++ b/packages/ember-metal/tests/run_loop/later_test.js @@ -3,6 +3,7 @@ import run from 'ember-metal/run_loop'; var originalSetTimeout = window.setTimeout; var originalDateValueOf = Date.prototype.valueOf; +const originalPlatform = run.backburner._platform; function wait(callback, maxWaitCount) { maxWaitCount = isNone(maxWaitCount) ? 100 : maxWaitCount; @@ -33,6 +34,7 @@ function pauseUntil(time) { QUnit.module('run.later', { teardown() { + run.backburner._platform = originalPlatform; window.setTimeout = originalSetTimeout; Date.prototype.valueOf = originalDateValueOf; } @@ -197,13 +199,14 @@ asyncTest('setTimeout should never run with a negative wait', function() { // happens when an expired timer callback takes a while to run, // which is what we simulate here. var newSetTimeoutUsed; - window.setTimeout = function() { - var wait = arguments[arguments.length - 1]; - newSetTimeoutUsed = true; - ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number'); - // In IE8, `setTimeout.apply` is `undefined`. - var apply = Function.prototype.apply; - return apply.apply(originalSetTimeout, [this, arguments]); + run.backburner._platform = { + setTimeout() { + var wait = arguments[arguments.length - 1]; + newSetTimeoutUsed = true; + ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number'); + + return originalPlatform.setTimeout.apply(originalPlatform, arguments); + } }; var count = 0; @@ -226,7 +229,6 @@ asyncTest('setTimeout should never run with a negative wait', function() { }); wait(function() { - window.setTimeout = originalSetTimeout; QUnit.start(); ok(newSetTimeoutUsed, 'stub setTimeout was used'); });