Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 13 matching lines...) Expand all Loading... | |
24 const Cr = exports.Cr = { | 24 const Cr = exports.Cr = { |
25 NS_OK: 0, | 25 NS_OK: 0, |
26 NS_BINDING_ABORTED: 0x804B0002, | 26 NS_BINDING_ABORTED: 0x804B0002, |
27 NS_ERROR_FAILURE: 0x80004005 | 27 NS_ERROR_FAILURE: 0x80004005 |
28 }; | 28 }; |
29 | 29 |
30 const MILLIS_IN_SECOND = exports.MILLIS_IN_SECOND = 1000; | 30 const MILLIS_IN_SECOND = exports.MILLIS_IN_SECOND = 1000; |
31 const MILLIS_IN_MINUTE = exports.MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND; | 31 const MILLIS_IN_MINUTE = exports.MILLIS_IN_MINUTE = 60 * MILLIS_IN_SECOND; |
32 const MILLIS_IN_HOUR = exports.MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE; | 32 const MILLIS_IN_HOUR = exports.MILLIS_IN_HOUR = 60 * MILLIS_IN_MINUTE; |
33 | 33 |
34 function URL(urlString) | 34 // 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.)
| |
35 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.
| |
35 { | 36 { |
36 return require("url").parse(urlString); | 37 global.URL = require("url").URL; |
37 } | 38 } |
38 | 39 |
39 let Services = { | 40 let Services = { |
40 obs: { | 41 obs: { |
41 addObserver() {} | 42 addObserver() {} |
42 } | 43 } |
43 }; | 44 }; |
44 let XPCOMUtils = { | 45 let XPCOMUtils = { |
45 generateQI() {} | 46 generateQI() {} |
46 }; | 47 }; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 } | 410 } |
410 }) | 411 }) |
411 }; | 412 }; |
412 }; | 413 }; |
413 | 414 |
414 exports.unexpectedError = function(error) | 415 exports.unexpectedError = function(error) |
415 { | 416 { |
416 console.error(error); | 417 console.error(error); |
417 this.ok(false, "Unexpected error: " + error); | 418 this.ok(false, "Unexpected error: " + error); |
418 }; | 419 }; |
OLD | NEW |