Skip to content
Prev Previous commit
Next Next commit
Fix slice make
It needs to be of length 0 to allow for append from 0.
  • Loading branch information
ankur22 committed Nov 14, 2024
commit 134399b4273ecd631c6fa41bc0a91cec1623c827
2 changes: 1 addition & 1 deletion js/modules/gomodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (gm *goModule) Instantiate(rt *sobek.Runtime) (sobek.CyclicModuleInstance,
gm.exportedNames = obj.GetOwnPropertyNames()
}
default:
gm.exportedNames = make([]string, len(named))
gm.exportedNames = make([]string, 0, len(named))
for name := range named {
gm.exportedNames = append(gm.exportedNames, name)
}
Expand Down