-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assorted fixes #48
Open
asiekierka
wants to merge
61
commits into
luaj:master
Choose a base branch
from
asiekierka:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Assorted fixes #48
Conversation
This file contains 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
… signs when converting strings to numbers
Added PAIRS and IPAIRS constants to LuaValue Merged pairs and ipairs into one class with a dynamic constructor, this is similar to Lua's pairsmeta function. Check for and call it's specific metamethod if it's available.
Fix string.format's floating point implementation Disable space if explicitPlus is set Disable leftAdjust and zeroPad if no width is specified precision gets set to zero if only a dot is specified Add support for %a/A, Lua can use these and Java happens to support it
Fixes lengthAsUtf8, encodeToUtf8, and isValidUtf8 to support UTF-8's 4-byte sequences or UTF-16's surrogate pairs properly. Invalid surrogate pairs are converted to '?' as Java's converter does
Doridian
reviewed
Sep 3, 2019
src/core/org/luaj/vm2/LuaDouble.java
Outdated
@@ -21,6 +21,8 @@ | |||
******************************************************************************/ | |||
package org.luaj.vm2; | |||
|
|||
import jdk.nashorn.internal.objects.Global; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed and breaks compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, sorry!
The error message is more specific with luaj
Too many failing tests that need to be fixed first
Updated to latest upstream. |
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.
The source for all of these fixes is the "OpenComputers" Minecraft mod, which utilized LuaJ as one of its Lua engines for years - specifically: https://github.com/MightyPirates/OC-LuaJ ; their main goal was to remove disparities between real Lua 5.2 and LuaJ.
Most of my work in this pertains to ensuring the code still compiles in J2ME, as well as splitting up the large commits into smaller ones. Feel free to only merge some of these fixes, if some are not applicable to LuaJ.