Skip to content

Commit c81bca9

Browse files
committed
Merge pull request #12941 from rwjblue/update-backburner
[BUGFIX beta] Update Backburner.
2 parents 2397551 + a168d44 commit c81bca9

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"qunit-phantom-runner": "jonkemp/qunit-phantomjs-runner#1.2.0"
1111
},
1212
"devDependencies": {
13-
"backburner": "https://github.com/ebryn/backburner.js.git#22a4df33f23c40257bc49972e5833038452ded2e",
13+
"backburner": "https://github.com/ebryn/backburner.js.git#325a969dbc7eae42dc1edfbf0ae9fb83923df5a6",
1414
"rsvp": "https://github.com/tildeio/rsvp.js.git#3.0.20",
1515
"router.js": "https://github.com/tildeio/router.js.git#ed45bc5c5e055af0ab875ef2c52feda792ee23e4",
1616
"dag-map": "https://github.com/krisselden/dag-map.git#1.0.2",

packages/ember-metal/tests/run_loop/later_test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import run from 'ember-metal/run_loop';
33

44
var originalSetTimeout = window.setTimeout;
55
var originalDateValueOf = Date.prototype.valueOf;
6+
const originalPlatform = run.backburner._platform;
67

78
function wait(callback, maxWaitCount) {
89
maxWaitCount = isNone(maxWaitCount) ? 100 : maxWaitCount;
@@ -33,6 +34,7 @@ function pauseUntil(time) {
3334

3435
QUnit.module('run.later', {
3536
teardown() {
37+
run.backburner._platform = originalPlatform;
3638
window.setTimeout = originalSetTimeout;
3739
Date.prototype.valueOf = originalDateValueOf;
3840
}
@@ -197,13 +199,14 @@ asyncTest('setTimeout should never run with a negative wait', function() {
197199
// happens when an expired timer callback takes a while to run,
198200
// which is what we simulate here.
199201
var newSetTimeoutUsed;
200-
window.setTimeout = function() {
201-
var wait = arguments[arguments.length - 1];
202-
newSetTimeoutUsed = true;
203-
ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number');
204-
// In IE8, `setTimeout.apply` is `undefined`.
205-
var apply = Function.prototype.apply;
206-
return apply.apply(originalSetTimeout, [this, arguments]);
202+
run.backburner._platform = {
203+
setTimeout() {
204+
var wait = arguments[arguments.length - 1];
205+
newSetTimeoutUsed = true;
206+
ok(!isNaN(wait) && wait >= 0, 'wait is a non-negative number');
207+
208+
return originalPlatform.setTimeout.apply(originalPlatform, arguments);
209+
}
207210
};
208211

209212
var count = 0;
@@ -226,7 +229,6 @@ asyncTest('setTimeout should never run with a negative wait', function() {
226229
});
227230

228231
wait(function() {
229-
window.setTimeout = originalSetTimeout;
230232
QUnit.start();
231233
ok(newSetTimeoutUsed, 'stub setTimeout was used');
232234
});

0 commit comments

Comments
 (0)