Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js

Issue 3011503002: Revert "Add ticks counter to Timer." (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/isolate_helper.dart ('k') | runtime/lib/timer_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js
diff --git a/pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js b/pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js
index 0c432f514d0bec04a179a8853077b402c934f9ef..c330ad8fe4ae436de3456287b0850c9a3cf72609 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js
+++ b/pkg/dev_compiler/tool/input_sdk/private/preambles/d8.js
@@ -85,7 +85,7 @@ if (typeof global != "undefined") self = global; // Node.js.
var id = timerIdCounter++;
f.$timerId = id;
timerIds[id] = f;
- if (ms == 0 && !isNextTimerDue()) {
+ if (ms == 0) {
zeroTimerQueue.push(f);
} else {
addDelayedTimer(f, ms);
@@ -134,10 +134,7 @@ if (typeof global != "undefined") self = global; // Node.js.
var originalDate = Date;
var originalNow = originalDate.now;
function advanceTimeTo(time) {
- var now = originalNow();
- if (timeOffset < time - now) {
- timeOffset = time - now;
- }
+ timeOffset = time - originalNow();
}
function installMockDate() {
var NewDate = function Date(Y, M, D, h, m, s, ms) {
@@ -182,12 +179,6 @@ if (typeof global != "undefined") self = global; // Node.js.
}
}
- function isNextTimerDue() {
- if (timerHeap.length == 0) return false;
- var head = timerHeap[0];
- return head[0] < originalNow() + timeOffset;
- }
-
function nextDelayedTimerQueue() {
if (timerHeap.length == 0) return null;
var result = timerHeap[0];
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/isolate_helper.dart ('k') | runtime/lib/timer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698