From 1b9799d093c03733e69d07dd50cd0c3a883f1e73 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 5 Nov 2017 05:00:07 +0000 Subject: [PATCH] make test runner more robust --- .../build_support/mini_require.js | 20 +-- plugins/c9.vfs.standalone/www/test.html | 168 +++++++++--------- plugins/c9.vfs.standalone/www/testsuite.html | 142 --------------- 3 files changed, 95 insertions(+), 235 deletions(-) delete mode 100644 plugins/c9.vfs.standalone/www/testsuite.html diff --git a/node_modules/architect-build/build_support/mini_require.js b/node_modules/architect-build/build_support/mini_require.js index d08dfe93..7a5822d0 100644 --- a/node_modules/architect-build/build_support/mini_require.js +++ b/node_modules/architect-build/build_support/mini_require.js @@ -93,17 +93,18 @@ var addToLoadQueue = function(missing, deps, callback, errback) { var processLoadQueue = function(err, id) { var changed = false; if (err) { - define.errors[err.id] = err; + if (!id) id = err.id; + define.errors[id] = err; define.queue.forEach(function(r) { - if (r.map[err.id]) { + if (r.map[id]) { r.toLoad = -1; if (r.errback) r.errback(err); } }); - if (define.lastModule == err.id) + if (define.lastModule == id) define.lastModule = null; define.pending = define.pending.filter(function(p) { - return p != err.id; + return p != id; }); changed = true; } else if (id && !defQueue.length && !define.loaded[id]) { @@ -285,10 +286,10 @@ var config = require.config = function(cfg) { config.paths[p] = cfg.paths[p]; }); - if (cfg.useCache && global.caches) { + if (cfg.useCache && global.caches && location.protocol == "https:") { config.useCache = true; checkCache(); - } + } if (cfg.baseUrlLoadBalancers) config.baseUrlLoadBalancers = cfg.baseUrlLoadBalancers; @@ -457,12 +458,7 @@ var loadCached = function(path, cb) { return loadText(path, cb); function loadNew() { loadText(path, function(e, val, xhr) { - try { - var m = cb(e, val); - } catch(err) { - ideCache.delete(path); - throw err; - } + var m = cb(e, val); if (!e) { var ETAG = xhr.getResponseHeader("ETAG"); if (!ETAG) return; diff --git a/plugins/c9.vfs.standalone/www/test.html b/plugins/c9.vfs.standalone/www/test.html index fe3c75f0..ca783d2c 100644 --- a/plugins/c9.vfs.standalone/www/test.html +++ b/plugins/c9.vfs.standalone/www/test.html @@ -20,11 +20,6 @@ - - - \ No newline at end of file