diff options
Diffstat (limited to 'lib/js_checker')
-rw-r--r-- | lib/js_checker/constant_types.js | 10 | ||||
-rw-r--r-- | lib/js_checker/free_checker.js | 14 | ||||
-rw-r--r-- | lib/js_checker/js_checker.js | 72 | ||||
-rw-r--r-- | lib/js_checker/license_definitions.js | 10 | ||||
-rw-r--r-- | lib/js_checker/nontrivial_checker.js | 10 | ||||
-rw-r--r-- | lib/js_checker/pattern_utils.js | 10 | ||||
-rw-r--r-- | lib/js_checker/privacy_checker.js | 10 | ||||
-rw-r--r-- | lib/js_checker/privacy_threat_definitions.js | 10 | ||||
-rw-r--r-- | lib/js_checker/relation_checker.js | 10 |
9 files changed, 78 insertions, 78 deletions
diff --git a/lib/js_checker/constant_types.js b/lib/js_checker/constant_types.js index a2da0da..a1ef732 100644 --- a/lib/js_checker/constant_types.js +++ b/lib/js_checker/constant_types.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ //var debug = require("debug/debug"); diff --git a/lib/js_checker/free_checker.js b/lib/js_checker/free_checker.js index 9da4b35..cd1b421 100644 --- a/lib/js_checker/free_checker.js +++ b/lib/js_checker/free_checker.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ var licenses = require('./license_definitions'); @@ -185,10 +185,10 @@ exports.freeCheck = { * checkIsLastJsNode. * returns true if n is the last node. * Or if nodes before it are only comments etc (not valid code.) - * A special LibreJS node is appended at the end of a script tree to + * A special LibreJSXUL node is appended at the end of a script tree to * check if this is the last (and also for narcissus to keep the last comment * in the tree.) - * TODO: Refactor LibreJS so that END nodes can have a comment. + * TODO: Refactor LibreJSXUL so that END nodes can have a comment. */ checkIsLastNode: function (n) { // first check if the comment is part of the very last statement. diff --git a/lib/js_checker/js_checker.js b/lib/js_checker/js_checker.js index ecf0826..1d1fed9 100644 --- a/lib/js_checker/js_checker.js +++ b/lib/js_checker/js_checker.js @@ -1,24 +1,24 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * Copyright (C) 2015 Ruben Rodriguez * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ var {Cc, Ci, Cu, Cm, Cr} = require("chrome"); @@ -45,23 +45,23 @@ const timer = require("sdk/timers"); var callbackMap = {}; /** - * - * Pairs a hash with a given callback + * + * Pairs a hash with a given callback * method from an object. - * + * */ var setHashCallback = function(hash, callback, notification) { console.debug('setHashCallback', hash); if (hash in callbackMap && isDryRun()) { // workaround for issue with dryrun after checking box. // do nothing. - callbackMap[hash] = callback; + callbackMap[hash] = callback; } else if (hash in callbackMap) { console.debug("callback", callbackMap[hash]); if (notification && typeof notification.close === 'function') { notification.close(); } - throw Error("already being checked."); + throw Error("already being checked."); } else { console.debug('setting callbackMap for', hash, 'to', callback); callbackMap[hash] = callback; @@ -78,7 +78,7 @@ var removeHashCallback = function(hash) { /** * find callback and return result (parse tree). - * + * */ exports.callbackHashResult = function(hash, result) { console.debug('typeof callbackMap function:', typeof callbackMap[hash]); @@ -167,7 +167,7 @@ JsChecker.prototype.isFreeLicensed = function(script) { JsChecker.prototype.searchJs = function(jsCode, resultReady, url) { var that = this; var bugfix = require('../html_script_finder/bug_fix') - .narcissusBugFixLibreJS; + .narcissusBugFixLibreJSXUL; console.debug('JsChecker.searchJs for script url:', url); this.url = url; this.resultReady = resultReady; @@ -177,7 +177,7 @@ JsChecker.prototype.searchJs = function(jsCode, resultReady, url) { .createNotification(this.shortText).notification; var verbatimCode = this.jsCode.replace(bugfix, ''); - this.hash = scriptsCached.getHash(verbatimCode); + this.hash = scriptsCached.getHash(verbatimCode); var isCached = scriptsCached.isCached(verbatimCode, this.hash); if (isCached) { console.debug("We have it cached indeed!"); @@ -254,14 +254,14 @@ JsChecker.prototype.handleTree = function(tree, errorMessage) { /** * getCheckerResult - * + * * Callback to Assign result from walkTree to property. * reset parse tree. create cache entry. - * + * */ JsChecker.prototype.getCheckerResult = function(result) { // done with parse tree. Get rid of it. - this.parseTree = {}; + this.parseTree = {}; this.removeNotification(); this.parseTree.nonTrivialChecker = this.nonTrivialChecker; @@ -279,13 +279,13 @@ JsChecker.prototype.getCheckerResult = function(result) { /** * trivialCheck * - * Runs nodes through a series of conditional statements + * Runs nodes through a series of conditional statements * to find out whether it is trivial or not. * * @param {object} n. The current node being studied. - * @param {string} t. The type of node being studied + * @param {string} t. The type of node being studied * (initializer, functionbody, try block, ...) - * + * */ JsChecker.prototype.trivialCheck = function(n) { return this.nonTrivialChecker.checkNontrivial(n); @@ -294,12 +294,12 @@ JsChecker.prototype.trivialCheck = function(n) { /** * freeCheck * - * Check if comments above current node could be a free licence. + * Check if comments above current node could be a free licence. * If it is, then the script will be flagged as free. * * @param {object} n. The current node being studied. * (initializer, functionbody, try block, ...) - * + * */ JsChecker.prototype.freeCheck = function(n, ntype) { var check = freeChecker.freeCheck.checkNodeFreeLicense(n, this.queue); @@ -308,8 +308,8 @@ JsChecker.prototype.freeCheck = function(n, ntype) { /** * walkTree - * - * An iterative functionwalking the parse tree generated by + * + * An iterative functionwalking the parse tree generated by * Narcissus. * * @param {object} node. The original node. @@ -317,10 +317,10 @@ JsChecker.prototype.freeCheck = function(n, ntype) { */ JsChecker.prototype.walkTree = function(node) { var queue = [node]; - var i, + var i, len, - n, counter = 0, - result, + n, counter = 0, + result, processQueue, that = this; @@ -352,7 +352,7 @@ JsChecker.prototype.walkTree = function(node) { // fetch all the children. len = n.children.length; for (i = 0; i < len; i++) { - if (n.children[i] != undefined && + if (n.children[i] != undefined && n.children[i].visited == undefined ) { // figure out siblings. @@ -374,11 +374,11 @@ JsChecker.prototype.walkTree = function(node) { if (n.type != undefined) { // fetch all properties that may have nodes. for (var item in n) { - if (item != 'tokenizer' && + if (item != 'tokenizer' && item != 'children' && - item != 'length' && - n[item] != null && - typeof n[item] === 'object' && + item != 'length' && + n[item] != null && + typeof n[item] === 'object' && n[item].type != undefined && n[item].visited == undefined ) { @@ -413,7 +413,7 @@ JsChecker.prototype.walkTree = function(node) { if ((end - start) > 30) { // been running more than 20ms, pause - // for 10 ms before calling processQueue + // for 10 ms before calling processQueue // again. timer.setTimeout(processQueue, 8); return; @@ -451,10 +451,10 @@ JsChecker.prototype.cancelWalkTree = function() { /** * walkTreeComplete - * + * * Trigger when the walkTree has been completed or * when it has been cut short. - * + * */ JsChecker.prototype.walkTreeComplete = function(result) { var that = this; @@ -499,9 +499,9 @@ JsChecker.prototype.walkTreeComplete = function(result) { /** * checkNode - * + * * checks a single node. - * + * */ JsChecker.prototype.checkNode = function(n) { var sub; diff --git a/lib/js_checker/license_definitions.js b/lib/js_checker/license_definitions.js index 26e56a0..90107e4 100644 --- a/lib/js_checker/license_definitions.js +++ b/lib/js_checker/license_definitions.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ exports.types = { SHORT: 'short', diff --git a/lib/js_checker/nontrivial_checker.js b/lib/js_checker/nontrivial_checker.js index 1c79a2a..21cf478 100644 --- a/lib/js_checker/nontrivial_checker.js +++ b/lib/js_checker/nontrivial_checker.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ const types = require("./constant_types"); diff --git a/lib/js_checker/pattern_utils.js b/lib/js_checker/pattern_utils.js index b3e84d6..ebb0b2e 100644 --- a/lib/js_checker/pattern_utils.js +++ b/lib/js_checker/pattern_utils.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ exports.patternUtils = { diff --git a/lib/js_checker/privacy_checker.js b/lib/js_checker/privacy_checker.js index fe0fa8a..3e6d747 100644 --- a/lib/js_checker/privacy_checker.js +++ b/lib/js_checker/privacy_checker.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ const privacyThreatJs = require('./privacy_threat_definitions.js'); diff --git a/lib/js_checker/privacy_threat_definitions.js b/lib/js_checker/privacy_threat_definitions.js index fd04dcf..49e503f 100644 --- a/lib/js_checker/privacy_threat_definitions.js +++ b/lib/js_checker/privacy_threat_definitions.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ exports.js = { diff --git a/lib/js_checker/relation_checker.js b/lib/js_checker/relation_checker.js index 21580a9..50769c0 100644 --- a/lib/js_checker/relation_checker.js +++ b/lib/js_checker/relation_checker.js @@ -1,23 +1,23 @@ /** - * GNU LibreJS - A browser add-on to block nonfree nontrivial JavaScript. + * GNU LibreJSXUL - A browser add-on to block nonfree nontrivial JavaScript. * * * Copyright (C) 2011, 2012, 2013, 2014 Loic J. Duros * Copyright (C) 2014, 2015 Nik Nyby * - * This file is part of GNU LibreJS. + * This file is part of GNU LibreJSXUL. * - * GNU LibreJS is free software: you can redistribute it and/or modify + * GNU LibreJSXUL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * GNU LibreJS is distributed in the hope that it will be useful, + * GNU LibreJSXUL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. + * along with GNU LibreJSXUL. If not, see <http://www.gnu.org/licenses/>. */ /** * relation_checker.js |