Bug 1048833 - Prevent unnecessary SpecialPowers loading. r=dburns

This commit is contained in:
Malini Das 2014-08-06 08:33:00 -04:00
parent 7b4a23fef5
commit acf000fc8b

View File

@ -402,9 +402,16 @@ function createExecuteContentSandbox(aWindow, timeout) {
}
});
XPCOMUtils.defineLazyGetter(sandbox, 'SpecialPowers', function() {
return new SpecialPowers(aWindow);
});
if (aWindow.wrappedJSObject.SpecialPowers != undefined) {
XPCOMUtils.defineLazyGetter(sandbox, 'SpecialPowers', function() {
return aWindow.wrappedJSObject.SpecialPowers;
});
}
else {
XPCOMUtils.defineLazyGetter(sandbox, 'SpecialPowers', function() {
return new SpecialPowers(aWindow);
});
}
sandbox.asyncComplete = function sandbox_asyncComplete(value, status, stack, commandId) {
if (commandId == asyncTestCommandId) {