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

Unified Diff: lib/matcher.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
Index: lib/matcher.js
===================================================================
--- a/lib/matcher.js
+++ b/lib/matcher.js
@@ -17,27 +17,26 @@
"use strict";
/**
* @fileOverview Matcher class implementing matching addresses against
* a list of filters.
*/
-const {Filter, WhitelistFilter} = require("./filterClasses");
+import {Filter, WhitelistFilter} from "./filterClasses";
/**
* Blacklist/whitelist filter matching
* @constructor
*/
-function Matcher()
+export function Matcher()
{
this.clear();
}
-exports.Matcher = Matcher;
Matcher.prototype = {
/**
* Lookup table for filters by their associated keyword
* @type {Map.<string,Filter>}
*/
filterByKeyword: null,
@@ -239,23 +238,22 @@
};
/**
* Combines a matcher for blocking and exception rules, automatically sorts
* rules into two Matcher instances.
* @constructor
* @augments Matcher
*/
-function CombinedMatcher()
+export function CombinedMatcher()
{
this.blacklist = new Matcher();
this.whitelist = new Matcher();
this.resultCache = Object.create(null);
}
-exports.CombinedMatcher = CombinedMatcher;
/**
* Maximal number of matching cache entries to be kept
* @type {number}
*/
CombinedMatcher.maxCacheEntries = 1000;
CombinedMatcher.prototype =
@@ -442,9 +440,9 @@
return result;
}
};
/**
* Shared CombinedMatcher instance that should usually be used.
* @type {CombinedMatcher}
*/
-exports.defaultMatcher = new CombinedMatcher();
+export let defaultMatcher = new CombinedMatcher();
« lib/common.js ('K') | « lib/filterStorage.js ('k') | lib/notification.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld