Bug 553102 - Fix SpecialPowers DOMWindowUtils. r=ted

This commit is contained in:
Bobby Holley 2012-05-24 13:04:57 +02:00
Родитель 5a8b0dd58f
Коммит ec08cbb3fc
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -37,8 +37,12 @@ function bindDOMWindowUtils(aWindow) {
// apply to call them from this privileged scope. This way we don't
// have to explicitly stub out new methods that appear on
// nsIDOMWindowUtils.
//
// Note that this will be a chrome object that is (possibly) exposed to
// content. Make sure to define __exposedProps__ for each property to make
// sure that it gets through the security membrane.
var proto = Object.getPrototypeOf(util);
var target = {};
var target = { __exposedProps__: {} };
function rebind(desc, prop) {
if (prop in desc && typeof(desc[prop]) == "function") {
var oldval = desc[prop];
@ -57,6 +61,7 @@ function bindDOMWindowUtils(aWindow) {
rebind(desc, "set");
rebind(desc, "value");
Object.defineProperty(target, i, desc);
target.__exposedProps__[i] = 'rw';
}
return target;
}