-
Notifications
You must be signed in to change notification settings - Fork 40
wasm null should be mapped to JS undefined, not JS null #9
Comments
I disagree. My experience as author/designer of Scala.js is that Scala's The perfect mapping we found for
The key words here are for nullable types. But wasm also has non-nullable types, for example ints, and those are initialized with |
It might also be a source of confusion, because |
@rossberg, can you tag this as [js-api] so that it's plain that it doesn't block the core proposal? Thanks. |
Done. I also take the liberty to close this, since it is incompatible with the existing table API. |
As in any interlanguage mapping, no mapping is perfect but some are more useful than others.
NOTE: It may already be too late to make this change, even if we agree it would have been a good idea.
Wasm null is used for the uninitialized value on of values of nullable types. For nullable types, null will be the unique platform supported value to indicate that the expected value is absent. This corresponds most closely to the JS
undefined
rather than the JSnull
. For the ES specification itself,undefined
is consistently treated as the indicator of absence:The text was updated successfully, but these errors were encountered: