| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 atob: data => new Buffer(data, "base64").toString("binary"), | 76 atob: data => new Buffer(data, "base64").toString("binary"), |
| 77 btoa: data => new Buffer(data, "binary").toString("base64"), | 77 btoa: data => new Buffer(data, "binary").toString("base64"), |
| 78 Ci: { | 78 Ci: { |
| 79 }, | 79 }, |
| 80 Cu: { | 80 Cu: { |
| 81 import(resource) | 81 import(resource) |
| 82 { | 82 { |
| 83 let match = /^resource:\/\/gre\/modules\/(.+)\.jsm$/.exec(resource); | 83 let match = /^resource:\/\/gre\/modules\/(.+)\.jsm$/.exec(resource); |
| 84 let resourceName = match && match[1]; | 84 let resourceName = match && match[1]; |
| 85 if (resourceName && resources.hasOwnProperty(resourceName)) | 85 if (resourceName && resources.hasOwnProperty(resourceName)) |
| 86 return {[resourceName]: resources[resourceName]}; | 86 return {[resourceName]: resources[resourceName]}; |
|
Wladimir Palant
2017/03/09 14:37:14
This is a good case for the consistent-return rule
kzar
2017/03/10 06:56:14
Done.
| |
| 87 | |
| 88 throw new Error( | |
| 89 "Attempt to import unknown JavaScript module " + resource | |
| 90 ); | |
| 87 }, | 91 }, |
| 88 reportError(e) {} | 92 reportError(e) {} |
| 89 }, | 93 }, |
| 90 console: { | 94 console: { |
| 91 log() {}, | 95 log() {}, |
| 92 error() {} | 96 error() {} |
| 93 }, | 97 }, |
| 94 navigator: { | 98 navigator: { |
| 95 }, | 99 }, |
| 96 onShutdown: { | 100 onShutdown: { |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 round: Math.round | 435 round: Math.round |
| 432 } | 436 } |
| 433 }; | 437 }; |
| 434 }; | 438 }; |
| 435 | 439 |
| 436 exports.unexpectedError = function(error) | 440 exports.unexpectedError = function(error) |
| 437 { | 441 { |
| 438 console.error(error); | 442 console.error(error); |
| 439 this.ok(false, "Unexpected error: " + error); | 443 this.ok(false, "Unexpected error: " + error); |
| 440 }; | 444 }; |
| LEFT | RIGHT |