mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-23 21:22:14 +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() {
|
export function test() {
|
||||||
assert(wasm.property_is_enumerable({ foo: 42 }, "foo"));
|
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()
|
.test()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user