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

Unified Diff: lib/downloader.js

Issue 29715555: Issue 6447 - Switch to Harmony modules in lib/* (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created March 6, 2018, 7:42 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
« lib/common.js ('K') | « lib/coreUtils.js ('k') | lib/elemHide.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/downloader.js
===================================================================
--- a/lib/downloader.js
+++ b/lib/downloader.js
@@ -16,45 +16,45 @@
*/
"use strict";
/**
* @fileOverview Downloads a set of URLs in regular time intervals.
*/
-const {Utils} = require("utils");
+import {Utils} from "utils";
-const MILLIS_IN_SECOND = exports.MILLIS_IN_SECOND = 1000;
-const MILLIS_IN_MINUTE = exports.MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND;
-const MILLIS_IN_HOUR = exports.MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE;
-const MILLIS_IN_DAY = exports.MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR;
+export const MILLIS_IN_SECOND = 1000;
+export const MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND;
+export const MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE;
+export const MILLIS_IN_DAY = 24 * MILLIS_IN_HOUR;
-let Downloader =
/**
* Creates a new downloader instance.
* @param {Function} dataSource
* Function that will yield downloadable objects on each check
* @param {number} initialDelay
* Number of milliseconds to wait before the first check
* @param {number} checkInterval
* Interval between the checks
* @constructor
*/
-exports.Downloader = function(dataSource, initialDelay, checkInterval)
+export function Downloader(dataSource, initialDelay, checkInterval)
{
this.dataSource = dataSource;
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this._timer.initWithCallback(() =>
{
this._timer.delay = checkInterval;
this._doCheck();
}, initialDelay, Ci.nsITimer.TYPE_REPEATING_SLACK);
this._downloading = Object.create(null);
-};
+}
+
Downloader.prototype =
{
/**
* Timer triggering the downloads.
* @type {nsITimer}
*/
_timer: null,
@@ -359,20 +359,21 @@
}
};
/**
* An object that can be downloaded by the downloadable
* @param {string} url URL that has to be requested for the object
* @constructor
*/
-let Downloadable = exports.Downloadable = function Downloadable(url)
+export function Downloadable(url)
{
this.url = url;
-};
+}
+
Downloadable.prototype =
{
/**
* URL that has to be requested for the object.
* @type {string}
*/
url: null,
« lib/common.js ('K') | « lib/coreUtils.js ('k') | lib/elemHide.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld