Improve compatibility with lua 5.2.

This commit is contained in:
James Roseborough
2012-09-30 15:42:36 +00:00
parent a529cbaf5c
commit 8b50a3b36b
5 changed files with 209 additions and 140 deletions

View File

@@ -8,13 +8,12 @@
--
local pcall = function(...)
local s,e,f = pcall(...)
return s,type(e)
return s,type(e),type(f)
end
print( 'os', type(os) )
print( 'os.clock()', pcall( os.clock ) )
print( 'os.date()', pcall( os.date ) )
print( 'os.difftime(123000, 21500)', pcall( os.difftime, 123000, 21250 ) )
print( 'os.execute("bogus")', pcall( os.execute, '' ) )
print( 'os.getenv()', pcall( os.getenv ) )
print( 'os.getenv("bogus.key")', pcall( os.getenv, 'bogus.key' ) )
local s,p = pcall( os.tmpname )