Bug 1489455 - Replace evalInSandbox from httpd.js r=valentin

Differential Revision: https://phabricator.services.mozilla.com/D5243

--HG--
extra : moz-landing-system : lando
This commit is contained in:
vinoth 2018-09-07 13:27:24 +00:00
parent 2963382a49
commit dae6ac4ec4

View File

@ -2797,7 +2797,12 @@ ServerHandler.prototype =
// getting the line number where we evaluate the SJS file. Don't
// separate these two lines!
var line = new Error().lineNumber;
Cu.evalInSandbox(sis.read(file.fileSize), s, "latest");
let uri = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService)
.newFileURI(file);
let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader);
scriptLoader.loadSubScript(uri.spec, s);
}
catch (e)
{