From d77b38fc60d5110d1ce6c94a0b64337f860fb502 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 21 Dec 2016 12:47:10 +0100 Subject: Fix for running tests with ES5 --- js/bin/HttpServer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/bin/HttpServer.js') diff --git a/js/bin/HttpServer.js b/js/bin/HttpServer.js index 400577fef5a..29e9cb1a1b2 100644 --- a/js/bin/HttpServer.js +++ b/js/bin/HttpServer.js @@ -171,6 +171,8 @@ function Init() var m = es5 ? matchController[1].replace("es5/", "") : matchController[1]; var testpath = path.resolve(path.join(this._basePath, "test", matchController[1])) var scripts = es5 ? [ + "/node_modules/babel-polyfill/dist/polyfill.js", + "/node_modules/regenerator-runtime/runtime.js", "/lib/es5/Ice.js", "/test/es5/Common/Controller.js", "/test/es5/Common/ControllerI.js", @@ -208,8 +210,10 @@ function Init() } var filePath = path.resolve(path.join(basePath, req.url.pathname)); - if(filePath.indexOf("es5/") !== -1 && path.extname(filePath) != "js") + if(filePath.indexOf("es5/") !== -1 && path.extname(filePath) != ".js") { + // We only host JS files in the es5 subdirectory, other files + // (such as config/escapes.cfg are in test) filePath = filePath.replace("es5/", "") } -- cgit v1.2.3