mirror of
https://github.com/micropython/micropython.git
synced 2025-09-07 18:30:27 +02:00
JavaScript code uses "Symbol in object" to brand check its own proxies, and such checks should also work on the Python side. Signed-off-by: Andrea Giammarchi <andrea.giammarchi@gmail.com>
14 lines
335 B
JavaScript
14 lines
335 B
JavaScript
// 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);
|