New autoload and math test cases. Currently autoload does not work because
the GETGLOBAL instruction does not handle the case where a metatable method is invoked.
This commit is contained in:
11
src/test/res/autoload.lua
Normal file
11
src/test/res/autoload.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
local function autoload(table, key)
|
||||
local chunk = loadfile("/"..key..".luac")
|
||||
table[key] = chunk()
|
||||
end
|
||||
|
||||
autoload_mt = { __index = autoload }
|
||||
|
||||
setmetatable(_G, autoload_mt)
|
||||
|
||||
print("square root of 9.0 is ", math.sqrt(9.0))
|
||||
print("math.pi=", math.pi);
|
||||
Reference in New Issue
Block a user