mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Fix test of Symbol.hasInstance
This commit is contained in:
parent
2518048f25
commit
bd068207a1
@ -26,10 +26,14 @@ fn has_instance() {
|
||||
r#"
|
||||
import * as assert from "assert";
|
||||
import * as wasm from "./out";
|
||||
class Array1 {}
|
||||
Object.defineProperty(Array1, wasm.symbol_has_instance(), {
|
||||
value: (instance: any) => Array.isArray(instance)
|
||||
});
|
||||
|
||||
export function test() {
|
||||
assert.ok(wasm.symbol_has_instance());
|
||||
assert.ok([] instanceof Array);
|
||||
assert.equal(typeof wasm.symbol_has_instance(), "symbol");
|
||||
assert.ok([] instanceof Array1);
|
||||
}
|
||||
"#,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user