Allow metatable operations on values of all types, and use the metatable
on strings as the string package, so that string functions can be called with self (:) syntax. Autoload test case now inexplicably fails more, but it was already broken.
This commit is contained in:
5
src/test/res/metatables.lua
Normal file
5
src/test/res/metatables.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
-- The purpose of this test case is to demonstrate that
|
||||
-- basic metatable operations on non-table types work.
|
||||
-- i.e. that s.sub(s,...) could be used in place of string.sub(s,...)
|
||||
local s = "hello"
|
||||
print(s:sub(2,4))
|
||||
Reference in New Issue
Block a user