Skip to content

Commit cabe26e

Browse files
committed
tests/ports/webassembly: Add py_proxy_own_keys.mjs test.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 289f744 commit cabe26e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Test `Reflect.ownKeys(<py-obj>)` on the JavaScript side, which tests PyProxy.ownKeys.
2+
3+
const mp = await (await import(process.argv[2])).loadMicroPython();
4+
5+
mp.runPython(`
6+
x = []
7+
y = {}
8+
`);
9+
10+
console.log(Reflect.ownKeys(mp.globals.get("x")));
11+
console.log(Reflect.ownKeys(mp.globals.get("y")));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
'append', 'clear',
3+
'copy', 'count',
4+
'extend', 'index',
5+
'insert', 'pop',
6+
'remove', 'reverse',
7+
'sort'
8+
]
9+
[
10+
'clear', 'copy',
11+
'get', 'items',
12+
'keys', 'pop',
13+
'popitem', 'setdefault',
14+
'update', 'values',
15+
'fromkeys', 'set',
16+
'delete'
17+
]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy