Bug 618101 - SyntaxError (let doesn't work) when loading bootstrap.js to call uninstall() from a disabled add-on. r=mossap. a=blocker.

This commit is contained in:
Asaf Romano (Mano) 2011-01-20 23:16:49 +02:00
Родитель 203be2bb25
Коммит 44fa98f0f7
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -3096,7 +3096,14 @@ var XPIProvider = {
createInstance(Ci.mozIJSSubScriptLoader);
try {
loader.loadSubScript(spec, this.bootstrapScopes[aId]);
// As we don't want our caller to control the JS version used for the
// bootstrap file, we run loadSubScript within the context of the
// sandbox with the latest JS version set explicitly.
this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = spec;
Components.utils.evalInSandbox(
"Components.classes['@mozilla.org/moz/jssubscript-loader;1'] \
.createInstance(Components.interfaces.mozIJSSubScriptLoader) \
.loadSubScript(__SCRIPT_URI_SPEC__);", this.bootstrapScopes[aId], "ECMAv5");
}
catch (e) {
WARN("Error loading bootstrap.js for " + aId, e);