You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support nullable UTF-8 string arguments in FFI signatures #1033
Add an FFI descriptor that accepts either ECMAScript text or null, marshalling strings as temporary NUL-terminated UTF-8 and null as a native null pointer.
Why
Many C APIs use nullable const char * parameters. GocciaScript currently forces a binding to choose between utf8string (convenient text, no null-pointer semantics) and pointer (null-capable, rejects JavaScript strings). GocciaScript-Raylib therefore emits seven additional Raw bindings for nullable C-string parameters; see the merged binding documentation.
Current behavior
On current main (34cc32f), using the existing FFI fixture:
The fresh-main FFI suite passes in interpreted and bytecode modes (92 tests, 337 assertions); a direct fresh-main stdin reproduction produced 4.
Expected behavior
A nullable UTF-8 string descriptor should marshal strings with the existing strict UTF-8/NUL validation and marshal null as a null pointer. Plain utf8string behavior may remain unchanged for compatibility if the nullable contract is explicit.
Scope notes
Preserve the ownership distinction: this is for borrowed nullable const char * inputs, not mutable or owned char * buffers.
Do not make arbitrary pointer descriptors coerce strings implicitly.
Activity