File: hostref.wat

package info (click to toggle)
nodejs 22.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 246,928 kB
  • sloc: cpp: 1,582,349; javascript: 582,017; ansic: 82,400; python: 60,561; sh: 4,009; makefile: 2,263; asm: 1,732; pascal: 1,565; perl: 248; lisp: 222; xml: 42
file content (24 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(module
  (import "" "f" (func $fun (param anyref) (result anyref)))

  (global $glob (export "global") (mut anyref) (ref.null))
  (table $tab (export "table") 10 anyref)

  (func (export "global.set") (param $r anyref)
    (global.set $glob (local.get $r))
  )
  (func (export "global.get") (result anyref)
    (global.get $glob)
  )

  (func (export "table.set") (param $i i32) (param $r anyref)
    (table.set $tab (local.get $i) (local.get $r))
  )
  (func (export "table.get") (param $i i32) (result anyref)
    (table.get $tab (local.get $i))
  )

  (func (export "func.call") (param $r anyref) (result anyref)
    (call $fun (local.get $r))
  )
)