fix(vm): boolean table keys, nan sentinel, set! encode errors, # on non-tables - #422
Open
dimamik wants to merge 4 commits into
Open
fix(vm): boolean table keys, nan sentinel, set! encode errors, # on non-tables#422dimamik wants to merge 4 commits into
dimamik wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks a lot for building this! We're about to release Legion, one of the sandboxes of which will be Lua.ex, and we stumbled upon a few non-urgent thingies around data transformation that we think are worth looking into:
Value.encode/3turnedtrue/falsemap keys into strings, so%{true => 1}came back as{["true"] = 1}.:nansentinel was not a number at the boundary:type(0/0)was"userdata",math.type(0/0)wasnil,tostring(0/0)was":nan", andLua.decode!/2raised on it.Lua.set!/3crashed with a bareFunctionClauseErroron valuesLua.encode!/2refuses withFailed to encode.#returned 0 for nil, booleans, numbers and functions instead of raising. Fixes length operator on nil/boolean returns 0 instead of raising #404.Thanks in advance, and let me know what you think!