| 1 |
;; RUN: wast --assert default --snapshot tests/snapshots % |
| 2 |
|
| 3 |
;; With what's defined so far, we can define a component that imports, links and exports other components: |
| 4 |
|
| 5 |
(component |
| 6 |
(import "c" (instance $c |
| 7 |
(export "f" (func (result string))) |
| 8 |
)) |
| 9 |
(import "d" (component $D |
| 10 |
(import "c" (instance $c |
| 11 |
(export "f" (func (result string))) |
| 12 |
)) |
| 13 |
(export "g" (func (result string))) |
| 14 |
)) |
| 15 |
(instance $d1 (instantiate $D |
| 16 |
(with "c" (instance $c)) |
| 17 |
)) |
| 18 |
(instance $d2 (instantiate $D |
| 19 |
(with "c" (instance |
| 20 |
(export "f" (func $d1 "g")) |
| 21 |
)) |
| 22 |
)) |
| 23 |
(export "d2" (instance $d2)) |
| 24 |
) |