Skip to content

Commit 583b314

Browse files
committed
Add dummy function for ownPropertyKeys
1 parent aae55da commit 583b314

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

components/script/window_named_properties.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ use js::glue::{CreateProxyHandler, NewProxyObject, ProxyTraps, RUST_JSID_IS_STRI
1717
use js::jsapi::JS_SetImmutablePrototype;
1818
use js::jsapi::{Handle, HandleObject, JSClass, JSContext, JSErrNum, UndefinedHandleValue};
1919
use js::jsapi::{
20-
HandleId, JSClass_NON_NATIVE, MutableHandle, ObjectOpResult, PropertyDescriptor,
21-
ProxyClassExtension, ProxyClassOps, ProxyObjectOps, JSCLASS_DELAY_METADATA_BUILDER,
22-
JSCLASS_IS_PROXY, JSCLASS_RESERVED_SLOTS_MASK, JSCLASS_RESERVED_SLOTS_SHIFT,
20+
HandleId, JSClass_NON_NATIVE, MutableHandle, MutableHandleIdVector, ObjectOpResult,
21+
PropertyDescriptor, ProxyClassExtension, ProxyClassOps, ProxyObjectOps,
22+
JSCLASS_DELAY_METADATA_BUILDER, JSCLASS_IS_PROXY, JSCLASS_RESERVED_SLOTS_MASK,
23+
JSCLASS_RESERVED_SLOTS_SHIFT,
2324
};
2425
use js::jsval::UndefinedValue;
2526
use js::rust::IntoHandle;
@@ -38,7 +39,7 @@ lazy_static! {
3839
enter: None,
3940
getOwnPropertyDescriptor: Some(get_own_property_descriptor),
4041
defineProperty: Some(define_property),
41-
ownPropertyKeys: None,
42+
ownPropertyKeys: Some(own_property_keys),
4243
delete_: Some(delete),
4344
enumerate: None,
4445
getPrototypeIfOrdinary: None,
@@ -113,6 +114,16 @@ unsafe extern "C" fn get_own_property_descriptor(
113114
return true;
114115
}
115116

117+
#[allow(unsafe_code)]
118+
unsafe extern "C" fn own_property_keys(
119+
_cx: *mut JSContext,
120+
_proxy: HandleObject,
121+
_props: MutableHandleIdVector,
122+
) -> bool {
123+
// FIXME(pylbrecht): dummy implementation
124+
true
125+
}
126+
116127
#[allow(unsafe_code)]
117128
unsafe extern "C" fn define_property(
118129
cx: *mut JSContext,

0 commit comments

Comments
 (0)