binary data support
This PR addresses two issues
- binary data can not properly be returned from lua, as it is "string" type in lua, which is assumed by wasmoon to be a regualr utf8 string
This PR handles it by reading the data directly from C memory to JS memory - Its up to you if u want to handle it this way, as it can affect performance, since it requires extra allocations
- Binary data can not be properly passed to lua as lua strings, that behave as lua string
This PR handles it by reading JS memory to C memory - It may be handled differentley by mocking string meta methods
Tests are failing, can you take a look?
I guess this fixes #122?
Tests are failing, can you take a look?
Looks like linter issues, will fix it, thanks
I guess this fixes https://github.com/ceifa/wasmoon/issues/122?
Yeap, as I wrote in the description, this aproach is a bit different than what is implemented now in wasmoon, you prefer not to copy the data to C memory, and only pass a reference to it ( I guess performance reasons), but it has some limitations
The return type here is string, but you added the return as number on the field?
Right I will fix it thanks, the idea here is that it returns a pointer, not sure how it worked like that for me :D
Fixed lint issues (not related to the PR, for some reason it failed) Made the code backward compatible, string now is a type extension Removed non used lua function definition