---
source: crates/codegen/tests/integration_test.rs
expression: wat
---
(module
(type (;0;) (func))
(type (;1;) (func (param i32 i32 i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32 i32 i32)))
(import "javy-default-plugin-v3" "cabi_realloc" (func (;0;) (type 1)))
(import "javy-default-plugin-v3" "invoke" (func (;1;) (type 2)))
(import "javy-default-plugin-v3" "memory" (memory (;0;) 0))
(export "_start" (func 4))
(export "log" (func 2))
(export "log2" (func 3))
(func (;2;) (type 0)
(local i32 i32)
i32.const 0
i32.const 0
i32.const 1
i32.const 396
call 0
local.tee 0
i32.const 0
i32.const 396
memory.init 0
data.drop 0
i32.const 0
i32.const 0
i32.const 1
i32.const 3
call 0
local.tee 1
i32.const 0
i32.const 3
memory.init 1
data.drop 1
local.get 0
i32.const 396
i32.const 1
local.get 1
i32.const 3
call 1
)
(func (;3;) (type 0)
(local i32 i32)
i32.const 0
i32.const 0
i32.const 1
i32.const 396
call 0
local.tee 0
i32.const 0
i32.const 396
memory.init 0
data.drop 0
i32.const 0
i32.const 0
i32.const 1
i32.const 4
call 0
local.tee 1
i32.const 0
i32.const 4
memory.init 2
data.drop 2
local.get 0
i32.const 396
i32.const 1
local.get 1
i32.const 4
call 1
)
(func (;4;) (type 0)
(local i32)
i32.const 0
i32.const 0
i32.const 1
i32.const 396
call 0
local.tee 0
i32.const 0
i32.const 396
memory.init 0
local.get 0
i32.const 396
i32.const 0
i32.const 0
i32.const 0
call 1
)
(data (;0;) "\15\07\01\18function.mjs\01\06log\01\08log2\01\0econsole\01(Hello from function!\01*Hello from function2!\014Hello from top-level scope\0d\c6\03\00\02\00\00\c8\03\00\01\ca\03\00\00\00\0c \0a\01\a2\01\00\00\00\03\02\02\1f\00\c8\03\00\01\ca\03\01\01\0cC\0a\01\c8\03\00\00\00\03\00\00\13\009\e6\00\00\00C\e4\00\00\00\04\e7\00\00\00$\01\00)\c6\03\01\07\04\03\034\10;function log() {\0a console.log(\22Hello from function!\22);\0a}\0cC\0a\01\ca\03\00\00\00\03\00\00\13\009\e6\00\00\00C\e4\00\00\00\04\e8\00\00\00$\01\00)\c6\03\05\08\04\03\054\10=function log2() {\0a console.log(\22Hello from function2!\22);\0a}\08\ec\08\c1\00\e3\c1\01\e4)9\e6\00\00\00C\e4\00\00\00\04\e9\00\00\00$\01\00\0e\06/\c6\03\01\01\06\00\0a\10\004\10\00")
(data (;1;) "log")
(data (;2;) "log2")
(@producers
(language "JavaScript" "ES2020")
(processed-by "Javy" "snapshot")
)
(@custom "javy_source" (after data) "export function log() {\0a console.log(\22Hello from function!\22);\0a}\0a\0aexport function log2() {\0a console.log(\22Hello from function2!\22);\0a}\0a\0aconsole.log(\22Hello from top-level scope\22);\0a")
)