Skip to content

Commit

Permalink
TODOs
Browse files Browse the repository at this point in the history
Signed-off-by: Nuno Cruces <[email protected]>
  • Loading branch information
ncruces committed Aug 13, 2024
1 parent 8ed7de8 commit b4e9f14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 6 additions & 5 deletions internal/wasm/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package wasm
import (
"context"
"encoding/binary"
"errors"
"fmt"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -659,20 +660,20 @@ func (s *Store) GetFunctionTypeID(t *FunctionType) (FunctionTypeID, error) {
}

// CloseWithExitCode implements the same method as documented on wazero.Runtime.
func (s *Store) CloseWithExitCode(ctx context.Context, exitCode uint32) (err error) {
func (s *Store) CloseWithExitCode(ctx context.Context, exitCode uint32) error {
s.mux.Lock()
defer s.mux.Unlock()
// Close modules in reverse initialization order.
var errs []error
for m := s.moduleList; m != nil; m = m.next {
// If closing this module errs, proceed anyway to close the others.
if e := m.closeWithExitCode(ctx, exitCode); e != nil && err == nil {
// TODO: use multiple errors handling in Go 1.20.
err = e // first error
if err := m.closeWithExitCode(ctx, exitCode); err != nil {
errs = append(errs, err)
}
}
s.moduleList = nil
s.nameToModule = nil
s.nameToModuleCap = 0
s.typeIDs = nil
return
return errors.Join(errs...)
}
3 changes: 0 additions & 3 deletions sys/stat_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import "io/fs"
// sysParseable is only used here as we define "supported" as being able to
// parse `info.Sys()`. The above `go:build` constraints exclude 32-bit until
// that's requested.
//
// TODO: When Go 1.21 is out, use the "unix" build constraint (as 1.21 makes
// our floor Go version 1.19.
const sysParseable = false

func statFromFileInfo(info fs.FileInfo) Stat_t {
Expand Down

0 comments on commit b4e9f14

Please sign in to comment.