mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 10:10:52 +00:00
adds missing unit tests for property_is_enumerable
This commit is contained in:
parent
1e1276410a
commit
420eaffcb3
@ -140,6 +140,15 @@ fn property_is_enumerable() {
|
||||
|
||||
export function test() {
|
||||
assert(wasm.property_is_enumerable({ foo: 42 }, "foo"));
|
||||
assert(wasm.property_is_enumerable({ 42: "foo" }, 42));
|
||||
assert(!wasm.property_is_enumerable({}, 42));
|
||||
|
||||
const obj = {};
|
||||
Object.defineProperty(obj, "foo", { enumerable: false });
|
||||
assert(!wasm.property_is_enumerable(obj, "foo"));
|
||||
|
||||
const s = Symbol();
|
||||
assert.ok(wasm.property_is_enumerable({ [s]: true }, s));
|
||||
}
|
||||
"#)
|
||||
.test()
|
||||
|
Loading…
x
Reference in New Issue
Block a user