Skip to content

Commit 7571718

Browse files
committed
tests/ports/webassembly: Add more tests.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 95a2769 commit 7571718

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/ports/webassembly/method_bind_behaviour.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ js.console.log(ar)
2020
# Add an element using prototype function, need to explicitly provide "ar" as context.
2121
print(push.call(ar, 4))
2222
js.console.log(ar)
23+
24+
# Add an element using a method with call and explicit context.
25+
print(ar.push.call(ar, 5))
26+
js.console.log(ar)
27+
28+
# Add an element using a different instances method with call and explicit context.
29+
print(js.Array().push.call(ar, 6))
30+
js.console.log(ar)
2331
`);
2432

2533
// Test assigning Python functions to JavaScript objects, and using them like a method.

tests/ports/webassembly/method_bind_behaviour.mjs.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
[ 1, 2, 3 ]
44
4
55
[ 1, 2, 3, 4 ]
6+
5
7+
[ 1, 2, 3, 4, 5 ]
8+
6
9+
[ 1, 2, 3, 4, 5, 6 ]
610
meth1 (1, 2)
711
meth2 (3, 4)

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