mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-14 05:21:24 +00:00
Add binding for Object.entries()
This commit is contained in:
@ -110,6 +110,19 @@ fn define_properties() {
|
||||
assert!(foo.has_own_property(&"car".into()));
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn entries() {
|
||||
let entries = Object::entries(&foo_42());
|
||||
assert_eq!(entries.length(), 1);
|
||||
entries.for_each(&mut |x, _, _| {
|
||||
assert!(x.is_object());
|
||||
let array: Array = x.into();
|
||||
assert_eq!(array.shift(), "foo");
|
||||
assert_eq!(array.shift(), 42);
|
||||
assert_eq!(array.length(), 0);
|
||||
});
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn get_own_property_descriptor() {
|
||||
let foo = foo_42();
|
||||
|
Reference in New Issue
Block a user