MCPcopy Index your code
hub / github.com/gopherjs/gopherjs / TestGoroutineJsObject

Function TestGoroutineJsObject

tests/goroutine_test.go:279–292  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestGoroutineJsObject(t *testing.T) {
280 // Test that js.Object methods can be a goroutine body.
281 // https://github.com/gopherjs/gopherjs/issues/547.
282 if !(runtime.GOOS == "js" || runtime.GOARCH == "js") {
283 t.Skip("Test requires GopherJS")
284 }
285 o := js.Global.Get("Object").New()
286 go o.Set("x", "y")
287 // Wait until the goroutine executes successfully. Can't use locks here
288 // because goroutine body must be a bare js.Object method call.
289 for o.Get("x").String() != "y" {
290 runtime.Gosched()
291 }
292}
293
294func issue1106() {
295 select {

Callers

nothing calls this directly

Calls 4

GetMethod · 0.65
StringMethod · 0.65
NewMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…