micropython/tests/ports/webassembly
Damien George 77bd8fe5b8 webassembly: Reuse PyProxy objects when they are the same Python object.
This commit makes it so that PyProxy objects are reused (on the JavaScript
side) when they correspond to an existing Python object that is the same
object.

For example, proxying the same Python function to JavaScript, the same
PyProxy instance is now used.  This means that if `foo` is a Python
function then accessing it on the JavaScript side such as
`api.globals().get("foo")` has the property that:

    api.globals().get("foo") === api.globals().get("foo")

Prior to this commit the above was not true because new PyProxy instances
were created each time `foo` was accessed.

Signed-off-by: Damien George <damien@micropython.org>
2024-07-19 11:55:24 +10:00
..
asyncio_await_resolve_no_arg.mjs webassembly/asyncio: Fix case where a Promise is resolved with no arg. 2024-05-13 11:48:41 +10:00
asyncio_await_resolve_no_arg.mjs.exp webassembly/asyncio: Fix case where a Promise is resolved with no arg. 2024-05-13 11:48:41 +10:00
asyncio_create_task.mjs webassembly: Add JavaScript-based asyncio support. 2024-04-24 16:24:00 +10:00
asyncio_create_task.mjs.exp webassembly: Add JavaScript-based asyncio support. 2024-04-24 16:24:00 +10:00
asyncio_sleep.mjs webassembly: Add JavaScript-based asyncio support. 2024-04-24 16:24:00 +10:00
asyncio_sleep.mjs.exp webassembly: Add JavaScript-based asyncio support. 2024-04-24 16:24:00 +10:00
asyncio_top_level_await.mjs webassembly/asyncio: Schedule run loop when tasks are pushed to queue. 2024-06-20 00:11:54 +10:00
asyncio_top_level_await.mjs.exp webassembly/asyncio: Schedule run loop when tasks are pushed to queue. 2024-06-20 00:11:54 +10:00
await_error_handling.mjs webassembly/proxy_c: Ensure objs thrown into generators are exceptions. 2024-05-13 11:52:17 +10:00
await_error_handling.mjs.exp webassembly/proxy_js: Create a special "undefined" type for Python. 2024-05-16 12:49:10 +10:00
await_js_async_py.mjs webassembly/proxy_c: Ensure return value of async fun is passed to JS. 2024-03-30 13:13:51 +11:00
await_js_async_py.mjs.exp webassembly/proxy_c: Ensure return value of async fun is passed to JS. 2024-03-30 13:13:51 +11:00
basic.js tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
basic.js.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
filesystem.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
filesystem.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
float.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
float.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
fun_call.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
fun_call.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
fun_proxy.mjs webassembly/proxy_js: Allow a Python proxy of a function to be undone. 2024-03-30 13:13:51 +11:00
fun_proxy.mjs.exp webassembly/proxy_js: Allow a Python proxy of a function to be undone. 2024-03-30 13:13:51 +11:00
fun_py_callback_js.mjs webassembly/proxy_js: Promote Python thenable to a Promise. 2024-03-30 13:13:51 +11:00
fun_py_callback_js.mjs.exp webassembly/proxy_js: Promote Python thenable to a Promise. 2024-03-30 13:13:51 +11:00
globals.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
globals.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
heap_expand.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
heap_expand.mjs.exp webassembly: Reuse PyProxy objects when they are the same Python object. 2024-07-19 11:55:24 +10:00
iterator.mjs webassembly/objpyproxy: Implement JS iterator protocol for Py iterables. 2024-05-07 00:20:56 +10:00
iterator.mjs.exp webassembly/objpyproxy: Implement JS iterator protocol for Py iterables. 2024-05-07 00:20:56 +10:00
js_proxy_attribute.mjs webassembly/objjsproxy: Lookup attributes without testing they exist. 2024-06-28 11:40:24 +10:00
js_proxy_attribute.mjs.exp webassembly/objjsproxy: Lookup attributes without testing they exist. 2024-06-28 11:40:24 +10:00
js_proxy_iterator.mjs webassembly/objjsproxy: Implement proxying of JS iterable protocol. 2024-06-18 22:14:34 +10:00
js_proxy_iterator.mjs.exp webassembly/objjsproxy: Implement proxying of JS iterable protocol. 2024-06-18 22:14:34 +10:00
jsffi_create_proxy.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
jsffi_create_proxy.mjs.exp webassembly/proxy_js: Create a special "undefined" type for Python. 2024-05-16 12:49:10 +10:00
jsffi_to_js.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
jsffi_to_js.mjs.exp webassembly/proxy_js: Create a special "undefined" type for Python. 2024-05-16 12:49:10 +10:00
override_new.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
override_new.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
promise_with_resolvers.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
promise_with_resolvers.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_delete.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_delete.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_dict_undefined.mjs webassembly/proxy_c: Return undefined if dict lookup failed on JS side. 2024-05-16 12:49:42 +10:00
py_proxy_dict_undefined.mjs.exp webassembly/proxy_c: Return undefined if dict lookup failed on JS side. 2024-05-16 12:49:42 +10:00
py_proxy_dict.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_dict.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_has.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_has.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_identity.mjs webassembly: Reuse PyProxy objects when they are the same Python object. 2024-07-19 11:55:24 +10:00
py_proxy_identity.mjs.exp webassembly: Reuse PyProxy objects when they are the same Python object. 2024-07-19 11:55:24 +10:00
py_proxy_own_keys.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_own_keys.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_set.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_set.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_to_js.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
py_proxy_to_js.mjs.exp webassembly/proxy_js: Revert back to converting Py None to JS null. 2024-05-16 12:44:43 +10:00
register_js_module.js tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
register_js_module.js.exp webassembly/proxy_js: Create a special "undefined" type for Python. 2024-05-16 12:49:10 +10:00
run_python_async2.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
run_python_async2.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
run_python_async_error.mjs webassembly/proxy_c: Reject promises with a PythonError instance. 2024-05-06 14:04:13 +10:00
run_python_async_error.mjs.exp webassembly/proxy_c: Reject promises with a PythonError instance. 2024-05-06 14:04:13 +10:00
run_python_async_no_await.mjs webassembly/api: Resolve thenables returned from runPythonAsync. 2024-05-07 11:33:05 +10:00
run_python_async_no_await.mjs.exp webassembly/api: Resolve thenables returned from runPythonAsync. 2024-05-07 11:33:05 +10:00
run_python_async.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
run_python_async.mjs.exp webassembly/proxy_js: Create a special "undefined" type for Python. 2024-05-16 12:49:10 +10:00
this_behaviour.mjs tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
this_behaviour.mjs.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
various.js tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00
various.js.exp tests/ports/webassembly: Add webassembly JS tests. 2024-03-22 14:31:25 +11:00