package util

import "github.com/tetratelabs/wazero/internal/gojs/util"

Index

Functions

func MustRead

func MustRead(mem api.Memory, funcName string, paramIdx int, offset, byteCount uint32) []byte

MustRead is like api.Memory except that it panics if the offset and byteCount are out of range.

func MustWrite

func MustWrite(mem api.Memory, fieldName string, offset uint32, val []byte)

MustWrite is like api.Memory except that it panics if the offset is out of range.

func NewFunc

func NewFunc(name string, goFunc api.GoModuleFunc) *wasm.HostFunc

func ResolvePath

func ResolvePath(cwd, path string) (resolved string)

ResolvePath is needed when a non-absolute path is given to a function. Unlike other host ABI, GOOS=js maintains the CWD host side.

Source Files

util.go

Version
v1.2.1
Published
Jun 14, 2023
Platform
js/wasm
Imports
5 packages
Last checked
9 hours ago

Tools for package owners.