Commit Graph

1127 Commits

Author SHA1 Message Date
James Roseborough
e126010a36 Add test for huge, sparse table initialization 2008-02-05 19:13:48 +00:00
James Roseborough
78bb849c08 Revert changes to getglobal() setglobal() 2008-02-05 19:13:14 +00:00
James Roseborough
bc5dd60a1a Fix LuaState.getglobal() and LuaState.setglobal() to use the currently closure's environment. 2008-01-29 00:17:50 +00:00
Ian Farmer
527ca6545d Fix bugs in LTable.
Two issues:
(1) When resizing, clearSlot() needs to be used to correctly move
affected hash entries.
(2) table.maxn is documented as returning the largest numeric key in
the table. This requires a linear scan through the entire table, but
the Lua documentation explicitly warns about that.
2008-01-23 02:22:19 +00:00
Ian Farmer
4fa417bdd9 Fix a bug with table resizing. Includes junit test case. 2008-01-23 01:21:54 +00:00
James Roseborough
f55a393fb8 Fix environment propogation from function to function. 2008-01-17 00:59:16 +00:00
Ian Farmer
32d5e9c15e Fix the bug where the wrong file/line# is reported on attempts to index nil. 2008-01-17 00:36:20 +00:00
Ian Farmer
08f4a02529 Fix error reporting in LValue.luaBinOpUnknown.
Since this method always fails with an error message, it should report its
own type, rather than the type of the other object, in the message.
2008-01-16 18:17:42 +00:00
Ian Farmer
4e239b6c46 Fix incorrect comparison in checkstack() when stack is one element too small. 2008-01-16 18:07:41 +00:00
Ian Farmer
1cddbe97a2 Add new test case for stack handling. 2008-01-16 06:07:59 +00:00
James Roseborough
8570761928 Make utf-8 conversion more robust to bad input. 2008-01-14 23:11:09 +00:00
Ian Farmer
2461b46908 Fix equality test for userdata. Includes improved test7.lua. 2008-01-11 07:56:42 +00:00
Shu Lei
9f9f31b969 Changes made for the following:
1) Platform.java stays as abstract class with, but default implementation is removed. Stays in org.luaj.vm package
2) org.luaj.platform package is created to hold concrete Platform implementations
3) Platform.newLuaState() method is introduced to instantiate the LuaState. Other constructors are privatized.
4) Following Platform implementations are created:
        J2sePlatform
        J2meMidp20Cldc11Platform
        J2meMidp10Cldc10Platform
 5) All clients of luaj-vm are changed to include startup code that looks something like this:
        Platform.setInstance( new J2meMidp20Cldc11Platform() );
        LuaState state = Platform.getInstance().newLuaState();
2007-12-19 21:44:15 +00:00
James Roseborough
bcf7dd1c66 Add tests for argument type checking on standard library functions. 2007-12-19 06:41:00 +00:00
Shu Lei
407d830582 1. code clean and added documentation for debugging protocol
2. upgrade to version 0.14 since I trimmed the debug message types
2007-12-17 19:42:02 +00:00
James Roseborough
d80e29a1ff More tests for module. 2007-12-13 22:12:21 +00:00
Shu Lei
5612201e43 1. bug fix: reset the VM when EOF occurs, which indicates that debug client or debug service exit abnormally
2. make LUA_PATH a system property instead of a command line option to StandardLuaJVM
2007-12-13 21:41:03 +00:00
Shu Lei
976c405033 fix the NPE. When the vm cannot connect to the debug client/service, it would not create the redirectOutputStream. Hence, no need to call redirectOutputStream.close() and BaseLib.restoreStandardOutput. 2007-12-13 01:49:15 +00:00
James Roseborough
9d728af4a6 Add simple loadstring test. 2007-12-13 01:43:21 +00:00
James Roseborough
78b231353f quote results. 2007-12-13 01:04:08 +00:00
James Roseborough
b8b65767b5 More test cases for string.sub() 2007-12-13 01:03:02 +00:00
Ian Farmer
60cc93d64c Correctly remove values stored in the array-part of a table. 2007-12-12 19:19:03 +00:00
James Roseborough
eef737fde1 Fix math.pow() for custom platforms. 2007-12-12 19:11:25 +00:00
James Roseborough
6569563ddc Implement math.pow() for all platforms, add unit tests for basic math operations. 2007-12-11 19:47:38 +00:00
Shu Lei
42b94709f0 1. added a shutdown method for LuaState and DebugLuaState to clean up before shutting down
2. added the capability to set LUA_PATH
3. minor debugging improvement
4. bump up the version to 0.12 because the addition outputRedirect debug message is not compatible with the previous versions
2007-12-11 01:51:28 +00:00
James Roseborough
ab8fc4883e Implement foreach(), foreachi() 2007-12-11 01:18:04 +00:00
James Roseborough
1923d8e6a0 Add math.random() and math.randomseed() 2007-12-08 01:42:51 +00:00
James Roseborough
215134feb5 Correct javadoc 2007-12-08 01:21:14 +00:00
James Roseborough
0f3fe0452d Add table.getn() for compatibility 2007-12-08 01:20:30 +00:00
Shu Lei
9706564647 simplify the debug protocol - no more ACK to debug client for resume, stepInto, stepOver and stepReturn 2007-12-08 00:40:45 +00:00
Shu Lei
f19fa165b9 1. added J2sePlatform for StandardLuaJVM to use J2SE DebugNetSupportImpl 2007-12-07 19:51:06 +00:00
James Roseborough
9cf85debad Add test cases for loadfile, dofile on bad filenames. 2007-12-07 18:43:34 +00:00
James Roseborough
66e78f6980 Merge STDOUT and stdout 2007-12-07 18:20:46 +00:00
Shu Lei
23710a8994 missed the file when I upgrade to version 0.11 2007-12-07 01:02:53 +00:00
James Roseborough
d7c15f99a1 fix setmetatable() to match C version 2007-12-07 00:52:39 +00:00
James Roseborough
dc08fcbec2 Send test error output to System.err 2007-12-06 23:31:11 +00:00
James Roseborough
e8e1aaf892 Fix for loop processing, add vmerror() 2007-12-06 22:59:16 +00:00
James Roseborough
6871903303 Add PackageLib.setLuaPath() utility method. 2007-12-06 21:53:42 +00:00
James Roseborough
2ee0a1eeed Add PackageLib.setLuaPath() utility method. 2007-12-06 21:52:37 +00:00
James Roseborough
edd8bc33ea remove compiled versions of test files 2007-12-06 21:14:44 +00:00
Ian Farmer
a6f46413c0 Added 'loops' test case.
This script tests the generic for loop using a Lua closure as the iterator
function, which is currently broken.
2007-12-06 19:16:56 +00:00
James Roseborough
644896c467 Improve error reporting. 2007-12-06 15:29:49 +00:00
James Roseborough
8f581c8f07 Improve testing around require() features. 2007-12-05 22:00:37 +00:00
James Roseborough
7db4d54d50 Implement require() using package.loaders, etc. add preload_loader, lua_loader, and java_loader. 2007-12-05 01:46:59 +00:00
Shu Lei
3c05880012 added getDebugHost() and getDebugPort() methods to Platform for convenience 2007-12-01 01:04:34 +00:00
Shu Lei
9fd34436fe minor refactoring 2007-12-01 00:40:51 +00:00
Shu Lei
ca721124e1 continuation of previous work to add factory method to create LuaState or DebugLuaState dynamically, refactored DebugSupport so that Platform.getInstance().getDebugSupport() does not depend on debug module 2007-12-01 00:17:18 +00:00
Shu Lei
96864694de added a factory method to LuaState to dynamically create LuaState or DebugLuaState depending on the presence of the platform debug properties 2007-11-30 23:47:44 +00:00
James Roseborough
0db9925ee9 Add test scripts for require() 2007-11-30 16:41:59 +00:00
Shu Lei
d7e0aeaac5 bug fix 2007-11-29 22:59:09 +00:00