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

Unified Diff: test/_common.js

Issue 29760704: Issue 6592 - Implement $rewrite filter option (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Just inject URL into the sandbox globals. Created May 17, 2018, 12:50 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
Index: test/_common.js
===================================================================
--- a/test/_common.js
+++ b/test/_common.js
@@ -26,21 +26,16 @@
NS_BINDING_ABORTED: 0x804B0002,
NS_ERROR_FAILURE: 0x80004005
};
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;
-function URL(urlString)
-{
- return require("url").parse(urlString);
-}
-
let Services = {
obs: {
addObserver() {}
}
};
let XPCOMUtils = {
generateQI() {}
};
@@ -70,17 +65,18 @@
log() {},
error() {}
},
navigator: {
},
onShutdown: {
add() {}
},
- URL
+ // URL is global in Node 10. In Node 7+ it must be imported.
+ URL: typeof URL == "undefined" ? require("url").URL : URL
};
let knownModules = new Map();
for (let dir of [path.join(__dirname, "stub-modules"),
path.join(__dirname, "..", "lib")])
{
for (let file of fs.readdirSync(path.resolve(dir)))
{
« lib/filterClasses.js ('K') | « test/.eslintrc.json ('k') | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld