mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 890081 - Make 'document' permanent in nsIDocument::WrapObject. r=bz
This commit is contained in:
parent
873d2309bf
commit
aa04d7f824
@ -11382,7 +11382,7 @@ nsIDocument::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aScope)
|
||||
(doc_str.get()),
|
||||
doc_str.Length(), JS::ObjectValue(*obj),
|
||||
JS_PropertyStub, JS_StrictPropertyStub,
|
||||
JSPROP_READONLY | JSPROP_ENUMERATE)) {
|
||||
JSPROP_READONLY | JSPROP_ENUMERATE | JSPROP_PERMANENT)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -4510,8 +4510,7 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// The PostCreate hook for the document will handle defining the
|
||||
// property
|
||||
// nsIDocument::WrapObject will handle defining the property.
|
||||
*objp = obj;
|
||||
|
||||
// NB: We need to do this for any Xray wrapper.
|
||||
|
@ -37,14 +37,27 @@ ok(canDefine, "Should have access to __defineGetter__ and __defineSetter__");
|
||||
try {
|
||||
this.__defineGetter__('window', function() {});
|
||||
ok(false, "should not be able to defineGetter(window)");
|
||||
} catch (e) {
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
try {
|
||||
this.__defineGetter__('document', function() {});
|
||||
ok(false, "should not be able to defineGetter(document)");
|
||||
} catch (e) { }
|
||||
|
||||
try {
|
||||
this.__defineGetter__.call(window, 'location', function(){});
|
||||
ok(false, "should not be able to defineGetter(window.location)");
|
||||
} catch (e) {
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
try {
|
||||
this.__defineGetter__.call(window, 'document', function(){});
|
||||
ok(false, "should not be able to defineGetter(window.document)");
|
||||
} catch (e) { }
|
||||
|
||||
try {
|
||||
this.__defineGetter__.call(document, 'location', function(){});
|
||||
ok(false, "should not be able to defineGetter(document.location)");
|
||||
} catch (e) { }
|
||||
|
||||
try {
|
||||
this.__defineGetter__.call(window.location, 'href', function(){});
|
||||
|
Loading…
Reference in New Issue
Block a user