Bug 781521 - Fix test_SpecialPowersExtension. r=Ms2ger

The constructor function lives in content, but it's being invoked from chrome, so the |this| object is actually privileged.
This commit is contained in:
Bobby Holley 2012-08-14 20:54:33 -07:00
parent 6a7102e955
commit 79e4222127

View File

@ -123,7 +123,7 @@ function starttest(){
var bis = new BinaryInputStream();
ok(/nsISupports/.exec(bis.toString()), "Should get the proper object out of the constructor");
function TestConstructor() {
this.foo = 2;
SpecialPowers.wrap(this).foo = 2;
}
var WrappedConstructor = SpecialPowers.wrap(TestConstructor);
is((new WrappedConstructor()).foo, 2, "JS constructors work properly when wrapped");