Closed thehowl closed 7 months ago
The section in gnolang where println
is called is from lines 935 to 955 in uverse.go. It seems to be an issue caused by not handling nil
values in this part. However, when the same code is run in Go, it outputs [0/0]0x0
. Should we modify it to simply print undefined
instead?
Should we modify it to simply print
undefined
instead?
Yeah, sounds adequate.
@thehowl do we want to modify standard Go behavior on Gno changing [0/0]0x0
output to undefined
?
IMHO we should default to keep the same behavior unless there is a good reasoning behind the change. We cannot know the implications of most of the changes until we hit the problem eventually.
@ajnavarro println
and print
are not properly "standardized" function where we should strive to have 100% compatibility with Go. See: Go spec#Bootstrapping, builtin#println. The documentation explicitly says:
The println built-in function formats its arguments in an implementation-specific way
(emphasis mine)
I think printing undefined
is acceptable as it is consistent with the behaviour when you perform println(nil)
.
Fixed by #1380
(@notJoon use "linking keywords" for your next PRs; see github doc)
panics with: