summaryrefslogtreecommitdiffstatshomepage
path: root/tests/ports/webassembly/py_proxy_has.mjs
blob: 37df0ae1794c9945f7647ab8abc60b608aecbd05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Test `<attr> in <py-obj>` on the JavaScript side, which tests PyProxy.has.

const mp = await (await import(process.argv[2])).loadMicroPython();

mp.runPython(`
x = []
`);

const x = mp.globals.get("x");
console.log("no_exist" in x);
console.log("sort" in x);
console.log(Symbol.toStringTag in x);
console.log(Symbol.iterator in x);