Return false when GetPropertyKeys fails

This commit is contained in:
Kagami Sascha Rosylight 2019-10-12 18:57:05 +09:00
parent a84d4ab755
commit 764f1a3724

View file

@ -5269,8 +5269,9 @@ class CGDOMJSProxyHandler_ownPropertyKeys(CGAbstractExternMethod):
""" """
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());
if !expando.is_null() { if !expando.is_null() &&
GetPropertyKeys(*cx, expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props); !GetPropertyKeys(*cx, expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props) {
return false;
} }
return true; return true;
@ -5314,8 +5315,9 @@ class CGDOMJSProxyHandler_getOwnEnumerablePropertyKeys(CGAbstractExternMethod):
""" """
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());
if !expando.is_null() { if !expando.is_null() &&
GetPropertyKeys(*cx, expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props); !GetPropertyKeys(*cx, expando.handle(), JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props) {
return false;
} }
return true; return true;