mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
In some cases, the global character of a value was lost, leading to undefined behaviour. Now a node level field of -1 means that the value is global, and that it should be accessed from the root data frame. Fixes #993.
16 lines
147 B
Go
16 lines
147 B
Go
package main
|
|
|
|
var m map[string]int64
|
|
|
|
func initVar() {
|
|
m = make(map[string]int64)
|
|
}
|
|
|
|
func main() {
|
|
initVar()
|
|
println(len(m))
|
|
}
|
|
|
|
// Output:
|
|
// 0
|