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

Unified Diff: lib/subscriptionClasses.js

Issue 29350382: Issue 4353 - Remove deprecated __proto__ syntax (Closed)
Patch Set: Make use of Object.getOwnPropertyDescriptor Created Sept. 2, 2016, 11:51 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/coreUtils.js ('K') | « lib/filterNotifier.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/subscriptionClasses.js
diff --git a/lib/subscriptionClasses.js b/lib/subscriptionClasses.js
index f559cb3937f42a8caff29135c7799e90c598183f..a5cc2adb6e574b9e892a67c44a5a3d3197f6fb1a 100644
--- a/lib/subscriptionClasses.js
+++ b/lib/subscriptionClasses.js
@@ -21,6 +21,7 @@
let {ActiveFilter, BlockingFilter, WhitelistFilter, ElemHideBase} = require("filterClasses");
let {FilterNotifier} = require("filterNotifier");
+let {desc} = require("coreUtils");
/**
* Abstract base class for filter subscriptions
@@ -229,10 +230,7 @@ function SpecialSubscription(url, title)
}
exports.SpecialSubscription = SpecialSubscription;
-SpecialSubscription.prototype =
-{
- __proto__: Subscription.prototype,
-
+SpecialSubscription.prototype = Object.create(Subscription.prototype, desc({
/**
* Filter types that should be added to this subscription by default
* (entries should correspond to keys in SpecialSubscription.defaultsMap).
@@ -272,14 +270,13 @@ SpecialSubscription.prototype =
if (this._lastDownload)
buffer.push("lastDownload=" + this._lastDownload);
}
-};
+}));
-SpecialSubscription.defaultsMap = {
- __proto__: null,
+SpecialSubscription.defaultsMap = Object.create(null, desc({
"whitelist": WhitelistFilter,
"blocking": BlockingFilter,
"elemhide": ElemHideBase
-};
+}));
/**
* Creates a new user-defined filter group.
@@ -327,10 +324,7 @@ function RegularSubscription(url, title)
}
exports.RegularSubscription = RegularSubscription;
-RegularSubscription.prototype =
-{
- __proto__: Subscription.prototype,
-
+RegularSubscription.prototype = Object.create(Subscription.prototype, desc({
_homepage: null,
_lastDownload: 0,
@@ -383,7 +377,7 @@ RegularSubscription.prototype =
if (this._lastDownload)
buffer.push("lastDownload=" + this._lastDownload);
}
-};
+}));
/**
* Class for filter subscriptions updated externally (by other extension)
@@ -398,10 +392,7 @@ function ExternalSubscription(url, title)
}
exports.ExternalSubscription = ExternalSubscription;
-ExternalSubscription.prototype =
-{
- __proto__: RegularSubscription.prototype,
-
+ExternalSubscription.prototype = Object.create(RegularSubscription.prototype, desc({
/**
* See Subscription.serialize()
*/
@@ -409,7 +400,7 @@ ExternalSubscription.prototype =
{
throw new Error("Unexpected call, external subscriptions should not be serialized");
}
-};
+}));
/**
* Class for filter subscriptions updated externally (by other extension)
@@ -424,10 +415,7 @@ function DownloadableSubscription(url, title)
}
exports.DownloadableSubscription = DownloadableSubscription;
-DownloadableSubscription.prototype =
-{
- __proto__: RegularSubscription.prototype,
-
+DownloadableSubscription.prototype = Object.create(RegularSubscription.prototype, desc({
_downloadStatus: null,
_lastCheck: 0,
_errors: 0,
@@ -549,4 +537,4 @@ DownloadableSubscription.prototype =
if (this.downloadCount)
buffer.push("downloadCount=" + this.downloadCount);
}
-};
+}));
« lib/coreUtils.js ('K') | « lib/filterNotifier.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld