New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall/js: expected panic on String method on null and undefined values #29536
Comments
/cc @neelance |
Hmm, I could have sworn that at some point in the past I saw tests that covered this case, precisely because (in contrast to the current implementation of GopherJS) we want to push any implicit type conversions back onto the call (i.e. force them to do the equivalent of |
/cc @alexbrainman (feel free to redirect to more appropriate person) |
@katiehockman - @neelance is the owner of the WASM port. |
Great, thanks @myitcv. |
Sorry, but I do not know much about syscall/js package. I am pretty sure @neelance is your man. Alex |
The documentation of
So this is working as expected. @sternix Why would you want a different behavior? |
Then I'm totally mistaken in my memory :) Indeed it's been like this since the start, so I'm clearly wrong! @neelance my memory is clearly influenced by the discussion we had on this topic for GopherJS, over in gopherjs/gopherjs#617. The conclusion we reached in that thread was:
Amongst the reasons we concluded on this being the "right" behaviour were:
Particularly given point 1, I think we need to reconsider the current behaviour. |
@neelance Thanks for reply, i expect String method acts like golang behavior, if this is expected behavior you can close issue. |
i think issue #29642 is the way go |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
a panic or string's zero value ""
What did you see instead?
"null" on null values
"undefined" on undefined values
The text was updated successfully, but these errors were encountered: