Open
Description
Consider the following code:
package main
import "fmt"
func main() {
var x int
go func() {
fmt.Println(&x)
}()
go func() {
fmt.Println(&x)
}()
}
The output of 'gopherjs run' is:
$ gopherjs run x.go
gopherjs: Source maps disabled. Use Node.js 4.x with source-map-support module for nice stack traces.
0x1
/home/jonhall/go/src/github.com/flimzy/x/x.go.705403117:1472
throw err;
^
ReferenceError: x$24ptr is not defined
at $b (/home/jonhall/go/src/github.com/flimzy/x/x.go.705403117:15912:37)
at $goroutine (/home/jonhall/go/src/github.com/flimzy/x/x.go.705403117:1463:19)
at $runScheduled [as _onTimeout] (/home/jonhall/go/src/github.com/flimzy/x/x.go.705403117:1504:7)
at Timer.listOnTimeout (timers.js:92:15)
When I look at the compiled JS output, I see the apparent problem (with line numbers):
15902 $go((function $b() {
15903 var $ptr, _r, x$24ptr, $s, $r;
15909 $go((function $b() {
15910 var $ptr, _r, $s, $r;