ui: Fix comments

This commit is contained in:
Hajime Hoshi 2019-01-17 23:40:33 +09:00
parent fd4cdd445c
commit 248f51cc02
2 changed files with 3 additions and 3 deletions

View File

@ -266,7 +266,6 @@ func init() {
window.Call("addEventListener", "load", js.NewCallback(func([]js.Value) {
close(ch)
}))
// TODO: This blocks the main goroutine on GopherJS, but should not.
<-ch
}
@ -382,7 +381,8 @@ func Run(width, height int, scale float64, title string, g GraphicsContext, main
return <-ch
}
// On GopherJS, the main goroutine must not be blocked. Return immediately.
// On GopherJS, the main goroutine cannot be blocked due to the bug (gopherjs/gopherjs#826).
// Return immediately.
go func() {
if err := <-ch; err != nil {
log.Fatal(err)

2
run.go
View File

@ -127,7 +127,7 @@ func run(width, height int, scale float64, title string, g *graphicsContext, mai
// 3) f returns error. In the case of 3), Run returns the same error.
//
// On GopherJS, Run returns immediately.
// It is because the 'main' goroutine cannot be blocked on GopherJS.
// It is because the 'main' goroutine cannot be blocked on GopherJS due to the bug (gopherjs/gopherjs#826).
// When an error happens, this is shown as an error on the console.
//
// The size unit is device-independent pixel.