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

Unified Diff: lib/notification.js

Issue 29548719: Issue 5728 - Replace Services.vc.compare (Closed)
Patch Set: Created Sept. 18, 2017, 6:05 p.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/coreUtils.js ('k') | test/_common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/notification.js
===================================================================
--- a/lib/notification.js
+++ b/lib/notification.js
@@ -21,14 +21,13 @@
* @fileOverview Handles notifications.
*/
-const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
-
const {Prefs} = require("prefs");
const {Downloader, Downloadable,
MILLIS_IN_MINUTE, MILLIS_IN_HOUR, MILLIS_IN_DAY} = require("downloader");
const {Utils} = require("utils");
const {Matcher, defaultMatcher} = require("matcher");
const {Filter, RegExpFilter, WhitelistFilter} = require("filterClasses");
+const {compareVersion} = require("coreUtils");
const INITIAL_DELAY = 1 * MILLIS_IN_MINUTE;
const CHECK_INTERVAL = 1 * MILLIS_IN_HOUR;
@@ -217,19 +216,19 @@
let targetChecks = {
extension: v => v == addonName,
extensionMinVersion:
- v => Services.vc.compare(addonVersion, v) >= 0,
+ v => compareVersion(addonVersion, v) >= 0,
extensionMaxVersion:
- v => Services.vc.compare(addonVersion, v) <= 0,
+ v => compareVersion(addonVersion, v) <= 0,
application: v => v == application,
applicationMinVersion:
- v => Services.vc.compare(applicationVersion, v) >= 0,
+ v => compareVersion(applicationVersion, v) >= 0,
applicationMaxVersion:
- v => Services.vc.compare(applicationVersion, v) <= 0,
+ v => compareVersion(applicationVersion, v) <= 0,
platform: v => v == platform,
platformMinVersion:
- v => Services.vc.compare(platformVersion, v) >= 0,
+ v => compareVersion(platformVersion, v) >= 0,
platformMaxVersion:
- v => Services.vc.compare(platformVersion, v) <= 0,
+ v => compareVersion(platformVersion, v) <= 0,
blockedTotalMin: v => Prefs.show_statsinpopup &&
Prefs.blocked_total >= v,
blockedTotalMax: v => Prefs.show_statsinpopup &&
« lib/coreUtils.js ('K') | « lib/coreUtils.js ('k') | test/_common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld