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: Properly polyfill URL for NodeJS Created May 16, 2018, 1:10 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
« no previous file with comments | « test/.eslintrc.json ('k') | test/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/_common.js
===================================================================
--- a/test/_common.js
+++ b/test/_common.js
@@ -26,19 +26,20 @@
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)
+// URL is global in Node 10. In Node 7+ it must be imported.
kzar 2018/05/16 13:24:31 (Thanks for noting the versions involved here.)
+if (global.URL == undefined)
kzar 2018/05/16 13:24:31 I wonder why we put it in the global Object here,
hub 2018/05/16 18:33:23 The previous polyfill was to define `function URL(
kzar 2018/05/17 09:49:01 Well for some longer functions we declare them ear
hub 2018/05/17 12:50:46 I had no doubt this would be working. Done.
{
- return require("url").parse(urlString);
+ global.URL = require("url").URL;
}
let Services = {
obs: {
addObserver() {}
}
};
let XPCOMUtils = {
« no previous file with comments | « test/.eslintrc.json ('k') | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld