diff --git a/README.html b/README.html index 12b224dd..344a6ab2 100644 --- a/README.html +++ b/README.html @@ -67,6 +67,7 @@ at improving on the 1.0 vm in the following aspects.
  • Improved class and package naming conventions.
  • Improved unit tests of core classes.
  • Improved quality due to major redesign and rewrite of core elements. +
  • Improved weak table support, including weak keys.

    2 - Simple Examples

    @@ -193,6 +194,31 @@ An ant script to build and run the midlet is in

    You must install the wireless toolkit and define WTK_HOME for this script to work. +

    Run a script using JSR-233 Dynamic Scripting

    + +

    +The standard use of JSR-233 scripting engines may be used: + +

    +	ScriptEngineManager mgr = new ScriptEngineManager();
    +	ScriptEngine e = mgr.getEngineByExtension(".lua");
    +	e.put("x", 25);
    +	e.eval("y = math.sqrt(x)");
    +	System.out.println( "y="+e.get("y") );
    +
    + +

    +All standard aspects of script engines including compiled statements should be supported. + +

    +You must include the library lib/luaj-jse-2.0.jar in your class path. + +

    +A working example may be found in +

    +	examples/jse/ScriptEngineSample.java
    +
    +

    Excluding the lua bytecode compiler

    By default, the compiler is included whenever standardGlobals() or debugGlobals() are called. @@ -239,31 +265,6 @@ lua source or lua binary files.

    The bcel library must be on the class path for this to work. -

    Run a script using JSR-233 Dynamic Scripting

    - -

    -The standard use of JSR-233 scripting engines may be used: - -

    -	ScriptEngineManager mgr = new ScriptEngineManager();
    -	ScriptEngine e = mgr.getEngineByExtension(".lua");
    -	e.put("x", 25);
    -	e.eval("y = math.sqrt(x)");
    -	System.out.println( "y="+e.get("y") );
    -
    - -

    -All standard aspects of script engines including compiled statements should be supported. - -

    -You must include the library lib/luaj-jse-2.0.jar in your class path. - -

    -A working example may be found in -

    -	examples/jse/ScriptEngineSample.java
    -
    -

    3 - Concepts

    Globals

    @@ -446,9 +447,7 @@ and LuaForge:

    Main Changes by Version

      2.0
      -
    • Core vm and core libraries completed. -
    • lua2java source-to-source compiler produces working files for all unit tests. -
    • luajc bytecode-to-bytecode compiler produces working files for all unit tests. +
    • Initial release of 2.0 version
    @@ -456,8 +455,9 @@ and LuaForge:
    • debug code may not be completely removed by some obfuscators
    • tail calls are not tracked in debug information -
    • using both version 1 and 2 libraries together in the same java vm has not been tested. +
    • using both version 1 and 2 libraries together in the same java vm has not been tested
    • module() and setfenv() only partially supported for lau2java or luajc compiled lua -
    • luajc may infer incorrect upvalue boundaries +
    • luajc can produce invalid class files in some cases +
    • values associated with weak keys may linger longer than expected
    diff --git a/src/jse/org/luaj/vm2/luajc/JavaBuilder.java b/src/jse/org/luaj/vm2/luajc/JavaBuilder.java index 35f490af..01afa650 100644 --- a/src/jse/org/luaj/vm2/luajc/JavaBuilder.java +++ b/src/jse/org/luaj/vm2/luajc/JavaBuilder.java @@ -729,6 +729,6 @@ public class JavaBuilder { public void appendBuffer() { append(factory.createInvoke(STR_LUAVALUE, "checkstring", TYPE_LUASTRING, Type.NO_ARGS, Constants.INVOKEVIRTUAL)); - append(factory.createInvoke(STR_BUFFER, "append", Type.VOID, new Type[] { TYPE_LUASTRING }, Constants.INVOKEVIRTUAL)); + append(factory.createInvoke(STR_BUFFER, "append", TYPE_BUFFER, new Type[] { TYPE_LUASTRING }, Constants.INVOKEVIRTUAL)); } } diff --git a/src/jse/org/luaj/vm2/luajc/JavaGen.java b/src/jse/org/luaj/vm2/luajc/JavaGen.java index b4f134de..93f7d5dc 100644 --- a/src/jse/org/luaj/vm2/luajc/JavaGen.java +++ b/src/jse/org/luaj/vm2/luajc/JavaGen.java @@ -161,7 +161,6 @@ public class JavaGen { case Lua.OP_CONCAT: /* A B C R(A):= R(B).. ... ..R(C) */ builder.newBuffer(); while ( b<=c ) { - builder.dup(); builder.loadLocal(pc, b++); builder.appendBuffer(); } diff --git a/test/junit/org/luaj/vm2/CompatibiltyTest.java b/test/junit/org/luaj/vm2/CompatibiltyTest.java index 46949145..1a87ecff 100644 --- a/test/junit/org/luaj/vm2/CompatibiltyTest.java +++ b/test/junit/org/luaj/vm2/CompatibiltyTest.java @@ -63,8 +63,8 @@ public class CompatibiltyTest { TestSuite suite = new TestSuite("Compatibility Tests"); suite.addTest( new TestSuite( JseCompatibilityTest.class, "JSE Tests" ) ); suite.addTest( new TestSuite( JmeCompatibilityTest.class, "JME Tests" ) ); - suite.addTest( new TestSuite( Lua2JavaTest.class, "Lua2Java Tests" ) ); suite.addTest( new TestSuite( JseBytecodeTest.class, "JSE Bytecode Tests" ) ); + suite.addTest( new TestSuite( Lua2JavaTest.class, "Lua2Java Tests" ) ); return suite; }