Skip to content

Commit f71b630

Browse files
0pcomdgryski
authored andcommitted
reflect: skip the MakeChan panic cases on every wasm target, not just wasip1
The guard was on runtime.GOOS == "wasip1", so under wasip2 the three cases that rely on recover ran anyway. recover does not work on wasm yet, so the panic escaped and trapped the test binary — which is the tinygo-test-wasip2-fast failure on this PR. Checked on runtime.GOARCH instead, since the limitation is wasm's rather than any one platform's. wasip1, wasip2 and js/wasm all set the tinygo.wasm build tag, and arch_tinygowasm.go defines GOARCH as wasm for it, so one condition covers all three of the wasm test targets. Worth noting for anyone reading targets/wasip2.json: the goarch there is arm, but that is what is handed to the Go toolchain for package selection — runtime.GOARCH is the one above.
1 parent 1579b23 commit f71b630

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/reflect/value_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,11 @@ func TestTinyMakeChan(t *testing.T) {
10451045
// The three cases below rely on recovering from a panic, which wasm
10461046
// cannot do yet without exceptions. Log and return rather than Skip:
10471047
// t.Skip needs the same machinery it is standing in for.
1048+
//
1049+
// Checked on GOARCH rather than GOOS because the limitation is wasm's, not
1050+
// any one platform's: this covers wasip1, wasip2 and js/wasm alike.
10481051
// TODO: drop this once tinygo-org/tinygo#5550 lands.
1049-
if runtime.GOOS == "wasip1" {
1052+
if runtime.GOARCH == "wasm" {
10501053
t.Log("not running the panic cases: panic/recover on wasm needs #5550")
10511054
return
10521055
}

0 commit comments

Comments
 (0)