1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-25 08:39:09 -05:00
denoland-deno/cli/tests/051_wasm_import/simple.wat
Kevin (Kun) "Kassimo" Qian 4189cc1ab5 Loader: support .wasm imports (#3328)
* loader: support .wasm imports

* http_server: true

* Support named exports

* Clippy
2019-11-14 08:31:39 -05:00

31 lines
897 B
Text

;; From https://github.com/nodejs/node/blob/bbc254db5db672643aad89a436a4938412a5704e/test/fixtures/es-modules/simple.wat
;; MIT Licensed
;; $ wat2wasm simple.wat -o simple.wasm
(module
(import "./wasm-dep.js" "jsFn" (func $jsFn (result i32)))
(import "./wasm-dep.js" "jsInitFn" (func $jsInitFn))
(import "http://127.0.0.1:4545/cli/tests/051_wasm_import/remote.ts" "jsRemoteFn" (func $jsRemoteFn (result i32)))
(export "add" (func $add))
(export "addImported" (func $addImported))
(export "addRemote" (func $addRemote))
(start $startFn)
(func $startFn
call $jsInitFn
)
(func $add (param $a i32) (param $b i32) (result i32)
local.get $a
local.get $b
i32.add
)
(func $addImported (param $a i32) (result i32)
local.get $a
call $jsFn
i32.add
)
(func $addRemote (param $a i32) (result i32)
local.get $a
call $jsRemoteFn
i32.add
)
)