Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/compat.js

Issue 29723558: Issue 6482 - Use ES6 classes (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created March 15, 2018, 7:46 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compat.js
===================================================================
--- a/lib/compat.js
+++ b/lib/compat.js
@@ -81,45 +81,41 @@
obs: {
addObserver() {},
removeObserver() {}
}
}
]
]);
-function FakeTimer()
+class FakeTimer
{
-}
-FakeTimer.prototype =
-{
- delay: 0,
Manish Jethani 2018/03/15 07:54:10 These are being assigned in the constructor (alway
- callback: null,
initWithCallback(callback, delay)
{
this.callback = callback;
this.delay = delay;
this.scheduleTimeout();
- },
+ }
+
scheduleTimeout()
{
window.setTimeout(() =>
{
try
{
this.callback();
}
catch (e)
{
Cu.reportError(e);
}
this.scheduleTimeout();
}, this.delay);
}
-};
+}
//
// Add a channel property to XMLHttpRequest, Synchronizer needs it
//
XMLHttpRequest.prototype.channel = {
status: -1,
loadFlags: 0,

Powered by Google App Engine
This is Rietveld