-
Notifications
You must be signed in to change notification settings - Fork 2
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_itervalues to JS. Attempting to access the value of such an exported global throws. There is no value you can pass to aWebAssembly.Globalconstructor 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
stringrefvalues is the set of JS strings, plus JSnull. - There is no default value for a
stringref. If astringrefargument is not supplied, that's an error. - There are no implicitly/automatically applied conversions: no
ToStringon numeric values passed asstringrefarguments, 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!
jakobkummerow
Metadata
Metadata
Assignees
Labels
No labels