Fix a few VM issues which were causing subtle failures in the test cases.

Includes a new VM method, newCall, which must be called before pushing
a call onto the stack to make sure that base is set correctly.
A couple of weird issues remain with autoload.lua.
This commit is contained in:
Ian Farmer
2007-09-04 01:52:33 +00:00
parent 0f81c4deaf
commit 75fb975410
8 changed files with 45 additions and 6 deletions

View File

@@ -1,11 +1,14 @@
-- Clear out builtin math package
math = nil
local function autoload(table, key)
local chunk = loadfile("/"..key..".luac")
local chunk = loadfile(key..".luac")
table[key] = chunk()
end
autoload_mt = { __index = autoload }
setmetatable(_G, autoload_mt)
setmetatable(_G, { __index = autoload } )
-- local result = math.sqrt(9.0)
-- print("x=", result)
print("square root of 9.0 is ", math.sqrt(9.0))
print("math.pi=", math.pi);