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

Unified Diff: lib/subscriptionClasses.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/rsa.js ('k') | lib/synchronizer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/subscriptionClasses.js
===================================================================
--- a/lib/subscriptionClasses.js
+++ b/lib/subscriptionClasses.js
@@ -16,37 +16,36 @@
*/
"use strict";
/**
* @fileOverview Definition of Subscription class and its subclasses.
*/
-const {ActiveFilter, BlockingFilter,
- WhitelistFilter, ElemHideBase} = require("./filterClasses");
-const {FilterNotifier} = require("./filterNotifier");
-const {desc, extend} = require("./coreUtils");
+import {ActiveFilter, BlockingFilter,
+ WhitelistFilter, ElemHideBase} from "./filterClasses";
+import {FilterNotifier} from "./filterNotifier";
+import {desc, extend} from "./coreUtils";
/**
* Abstract base class for filter subscriptions
*
* @param {string} url download location of the subscription
* @param {string} [title] title of the filter subscription
* @constructor
*/
-function Subscription(url, title)
+export function Subscription(url, title)
{
this.url = url;
this.filters = [];
if (title)
this._title = title;
Subscription.knownSubscriptions[url] = this;
}
-exports.Subscription = Subscription;
Subscription.prototype =
{
/**
* Download location of the subscription
* @type {string}
*/
url: null,
@@ -229,21 +228,20 @@
/**
* Class for special filter subscriptions (user's filters)
* @param {string} url see Subscription()
* @param {string} [title] see Subscription()
* @constructor
* @augments Subscription
*/
-function SpecialSubscription(url, title)
+export function SpecialSubscription(url, title)
{
Subscription.call(this, url, title);
}
-exports.SpecialSubscription = SpecialSubscription;
SpecialSubscription.prototype = extend(Subscription, {
/**
* Filter types that should be added to this subscription by default
* (entries should correspond to keys in SpecialSubscription.defaultsMap).
* @type {string[]}
*/
defaults: null,
@@ -333,21 +331,20 @@
/**
* Abstract base class for regular filter subscriptions (both
* internally and externally updated)
* @param {string} url see Subscription()
* @param {string} [title] see Subscription()
* @constructor
* @augments Subscription
*/
-function RegularSubscription(url, title)
+export function RegularSubscription(url, title)
{
Subscription.call(this, url, title || url);
}
-exports.RegularSubscription = RegularSubscription;
RegularSubscription.prototype = extend(Subscription, {
_homepage: null,
_lastDownload: 0,
/**
* Filter subscription homepage if known
* @type {string}
@@ -405,21 +402,20 @@
/**
* Class for filter subscriptions updated externally (by other extension)
* @param {string} url see Subscription()
* @param {string} [title] see Subscription()
* @constructor
* @augments RegularSubscription
*/
-function ExternalSubscription(url, title)
+export function ExternalSubscription(url, title)
{
RegularSubscription.call(this, url, title);
}
-exports.ExternalSubscription = ExternalSubscription;
ExternalSubscription.prototype = extend(RegularSubscription, {
/**
* See Subscription.serialize()
* @inheritdoc
*/
serialize(buffer)
{
@@ -431,21 +427,20 @@
/**
* Class for filter subscriptions updated externally (by other extension)
* @param {string} url see Subscription()
* @param {string} [title] see Subscription()
* @constructor
* @augments RegularSubscription
*/
-function DownloadableSubscription(url, title)
+export function DownloadableSubscription(url, title)
{
RegularSubscription.call(this, url, title);
}
-exports.DownloadableSubscription = DownloadableSubscription;
DownloadableSubscription.prototype = extend(RegularSubscription, {
_downloadStatus: null,
_lastCheck: 0,
_errors: 0,
/**
* Status of the last download (ID of a string)
« lib/common.js ('K') | « lib/rsa.js ('k') | lib/synchronizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld