diff options
Diffstat (limited to 'lib/script_entries')
-rw-r--r-- | lib/script_entries/free_libraries.js | 1 | ||||
-rw-r--r-- | lib/script_entries/scripts_cache.js | 13 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/script_entries/free_libraries.js b/lib/script_entries/free_libraries.js index 8821d04..f3354f6 100644 --- a/lib/script_entries/free_libraries.js +++ b/lib/script_entries/free_libraries.js @@ -40,7 +40,6 @@ var freeLibraries = JSON.parse(dbContents); /* a database of the free libraries */ var init = function () { - // relationChecker, which roughly checks if variables are window // variables or not, is useless in this case. Use the same // object for all entries. diff --git a/lib/script_entries/scripts_cache.js b/lib/script_entries/scripts_cache.js index 47ab069..dfc5e6a 100644 --- a/lib/script_entries/scripts_cache.js +++ b/lib/script_entries/scripts_cache.js @@ -19,11 +19,7 @@ * You should have received a copy of the GNU General Public License * along with GNU LibreJS. If not, see <http://www.gnu.org/licenses/>. */ -var relationCheckerObj = require("js_checker/relation_checker") - .relationChecker; - -// import free_libraries to populate the cache hash map. -var free_libraries = require("script_entries/free_libraries"); +var relationChecker = require("js_checker/relation_checker").relationChecker; var crypto = require('script_entries/crypto'); const checkTypes = require("js_checker/constant_types").checkTypes; @@ -52,6 +48,8 @@ ScriptsCached.prototype.getHash = function(scriptText) { */ ScriptsCached.prototype.resetCache = function () { cachedResults = {}; + // import free_libraries to populate the cache hash map. + var free_libraries = require("script_entries/free_libraries"); free_libraries.init(); }; @@ -64,11 +62,12 @@ ScriptsCached.prototype.resetCache = function () { * */ ScriptsCached.prototype.addEntry = function( - scriptText, result, relationChecker, allowTrivial, url) { + scriptText, result, relationCheckerObj, allowTrivial, url +) { console.debug("result addEntry is", JSON.stringify(result)); cachedResults[this.getHash(scriptText)] = { 'result': result, - 'relationChecker': relationCheckerObj(), + 'relationChecker': relationChecker(), 'allowTrivial': allowTrivial, 'url': url }; |