mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Properly set desc.obj in CodegenRust.py (fixes #11868)
This commit is contained in:
parent
eb6aec37e9
commit
baa94702e4
1 changed files with 2 additions and 3 deletions
|
@ -4982,7 +4982,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
args = [Argument('*mut JSContext', 'cx'), Argument('RawHandleObject', 'proxy'),
|
args = [Argument('*mut JSContext', 'cx'), Argument('RawHandleObject', 'proxy'),
|
||||||
Argument('RawHandleId', 'id'),
|
Argument('RawHandleId', 'id'),
|
||||||
Argument('RawMutableHandle<PropertyDescriptor>', 'desc')]
|
Argument('RawMutableHandle<PropertyDescriptor>', 'mut desc')]
|
||||||
CGAbstractExternMethod.__init__(self, descriptor, "getOwnPropertyDescriptor",
|
CGAbstractExternMethod.__init__(self, descriptor, "getOwnPropertyDescriptor",
|
||||||
"bool", args)
|
"bool", args)
|
||||||
self.descriptor = descriptor
|
self.descriptor = descriptor
|
||||||
|
@ -5055,7 +5055,6 @@ if %s {
|
||||||
else:
|
else:
|
||||||
namedGet = ""
|
namedGet = ""
|
||||||
|
|
||||||
# FIXME(#11868) Should assign to desc.obj, desc.get() is a copy.
|
|
||||||
return get + """\
|
return get + """\
|
||||||
rooted!(in(cx) let mut expando = ptr::null_mut::<JSObject>());
|
rooted!(in(cx) let mut expando = ptr::null_mut::<JSObject>());
|
||||||
get_expando_object(proxy, expando.handle_mut());
|
get_expando_object(proxy, expando.handle_mut());
|
||||||
|
@ -5068,7 +5067,7 @@ if !expando.is_null() {
|
||||||
}
|
}
|
||||||
if !desc.obj.is_null() {
|
if !desc.obj.is_null() {
|
||||||
// Pretend the property lives on the wrapper.
|
// Pretend the property lives on the wrapper.
|
||||||
desc.get().obj = proxy.get();
|
desc.obj = proxy.get();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue