mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-13 21:11:22 +00:00
Add binding for Object.getOwnPropertyNames()
This commit is contained in:
@ -122,6 +122,15 @@ fn get_own_property_descriptors() {
|
||||
assert_eq!(PropertyDescriptor::from(foo_desc).value(), 42);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn get_own_property_names() {
|
||||
let names = Object::get_own_property_names(&foo_42());
|
||||
assert_eq!(names.length(), 1);
|
||||
names.for_each(&mut |x, _, _| {
|
||||
assert_eq!(x, "foo");
|
||||
});
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn has_own_property() {
|
||||
assert!(foo_42().has_own_property(&"foo".into()));
|
||||
|
Reference in New Issue
Block a user