summaryrefslogtreecommitdiff
path: root/test/wasm2js/export_global.wast
diff options
context:
space:
mode:
authormagic-akari <akari.ccino@gmail.com>2022-03-18 01:27:28 +0800
committerGitHub <noreply@github.com>2022-03-17 17:27:28 +0000
commitb7e1989553a645968399ad379a86b809e04c0ae2 (patch)
tree714472a3d156ad55f1a8ba1618426426b7295433 /test/wasm2js/export_global.wast
parent86acb00c7095017f8bded15def3c928909099731 (diff)
downloadbinaryen-b7e1989553a645968399ad379a86b809e04c0ae2.tar.gz
binaryen-b7e1989553a645968399ad379a86b809e04c0ae2.tar.bz2
binaryen-b7e1989553a645968399ad379a86b809e04c0ae2.zip
[wasm2js] Support exports of Globals (#4523)
Export an object with a `.value` property like the wasm JS API does in browsers, and implement them with a getter and setter. Fixes #4522
Diffstat (limited to 'test/wasm2js/export_global.wast')
-rw-r--r--test/wasm2js/export_global.wast6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/wasm2js/export_global.wast b/test/wasm2js/export_global.wast
new file mode 100644
index 000000000..9b990be8d
--- /dev/null
+++ b/test/wasm2js/export_global.wast
@@ -0,0 +1,6 @@
+(module
+ (global $global0 i32 (i32.const 655360))
+ (export "HELLO" (global $global0))
+ (func (result i32) (i32.const 42))
+ (export "helloWorld" (func 0))
+) \ No newline at end of file