You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
funcmain() {
deferrecover()
panic(1)
}
Compare upstream vs gopherjs:
$ go run main.go
panic: 1
goroutine 1 [running]:
main.main()
/home/aleks/git/repro/035-defer-recover/main.go:5 +0x65
exit status 2
$ gopherjs run main.go
# No errors
While this may seem counter-intuitive, this is WAI according to golang/go#1272.
The text was updated successfully, but these errors were encountered:
This is likely because gopherjs wraps builtin deferrals into a proxy anonymous function, which makes it appear that recover() function is called from a deferred function, rather than being deferred itself. We can probably address this by decrementing $stackDepthOffset inside the proxy function.
Consider the following program:
Compare upstream vs gopherjs:
While this may seem counter-intuitive, this is WAI according to golang/go#1272.
The text was updated successfully, but these errors were encountered: