diff options
Diffstat (limited to 'js/baba-yaga/simple-js-test.baba')
-rw-r--r-- | js/baba-yaga/simple-js-test.baba | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/baba-yaga/simple-js-test.baba b/js/baba-yaga/simple-js-test.baba new file mode 100644 index 0000000..2575d33 --- /dev/null +++ b/js/baba-yaga/simple-js-test.baba @@ -0,0 +1,20 @@ +// simple-js-test.baba - Simple test for JS interop debugging + +// Test Math.abs +absResult : io.callJS "Math.abs" [-42]; +io.out "Math.abs result:"; +io.out absResult; + +// Test JSON.parse +jsonStr : "{\"name\": \"Alice\", \"age\": 30}"; +parseResult : io.callJS "JSON.parse" [jsonStr]; +io.out "JSON.parse result:"; +io.out parseResult; + +// Test property access +propResult : when parseResult is + Ok obj then io.getProperty obj "name" + Err msg then Err msg; + +io.out "Property access result:"; +io.out propResult; |