4 // Copyright 2020 The Go Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style
6 // license that can be found in the LICENSE file.
8 // Test race condition between timers and wasm calls that led to memory corruption.
19 ch1 := make(chan struct{})
23 time.Sleep(5 * time.Millisecond)
29 time.Sleep(8 * time.Millisecond)
34 time.Sleep(2 * time.Second)
39 ch2 := make(chan struct{}, 1)
40 f := js.FuncOf(func(this js.Value, args []js.Value) interface{} {
45 fn := js.Global().Get("Function").New("cb", "cb();")