mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
Fix accessing the bootstrap methods when they are declared in the new lexical scope
This commit is contained in:
parent
a968f1d6c2
commit
c54e714ef5
5 changed files with 61 additions and 3 deletions
|
|
@ -4436,7 +4436,18 @@ this.XPIProvider = {
|
|||
if (aAddon.type == "locale")
|
||||
return;
|
||||
|
||||
if (!(aMethod in this.bootstrapScopes[aAddon.id])) {
|
||||
let method = undefined;
|
||||
try {
|
||||
method = Components.utils.evalInSandbox(`${aMethod};`,
|
||||
this.bootstrapScopes[aAddon.id],
|
||||
"ECMAv5");
|
||||
}
|
||||
catch (e) {
|
||||
// An exception will be caught if the expected method is not defined.
|
||||
// That will be logged below.
|
||||
}
|
||||
|
||||
if (!method) {
|
||||
logger.warn("Add-on " + aAddon.id + " is missing bootstrap method " + aMethod);
|
||||
return;
|
||||
}
|
||||
|
|
@ -4455,9 +4466,9 @@ this.XPIProvider = {
|
|||
}
|
||||
|
||||
logger.debug("Calling bootstrap method " + aMethod + " on " + aAddon.id + " version " +
|
||||
aAddon.version);
|
||||
aAddon.version);
|
||||
try {
|
||||
this.bootstrapScopes[aAddon.id][aMethod](params, aReason);
|
||||
method(params, aReason);
|
||||
}
|
||||
catch (e) {
|
||||
logger.warn("Exception running bootstrap method " + aMethod + " on " + aAddon.id, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue