Open
Description
The MVP should probably define a JS API. AFAIU the work needed is to define a mapping between globals, tables, and function parameters and results of type stringref, stringview_wtf8, stringview_wtf16, and stringview_iter.
Current sloppily specified strawperson:
- You cannot convert
stringview_wtf8
,stringview_wtf16
, orstringview_iter
values to JS. Attempting to access the value of such an exported global throws. There is no value you can pass to aWebAssembly.Global
constructor that would succeed. Same for tables. Calling a function that takes a stringview parameter or returns a stringview result throws before the function is called; like it used to be fori64
. - The set of JS representations of
stringref
values is the set of JS strings, plus JSnull
. - There is no default value for a
stringref
. If astringref
argument is not supplied, that's an error. - There are no implicitly/automatically applied conversions: no
ToString
on numeric values passed asstringref
arguments, for example.
Regarding (3), perhaps we should default to null
when a JS value isn't given, as ref.null string
is the default value on the wasm side, because stringref
is nullable. Not sure!
Metadata
Metadata
Assignees
Labels
No labels