Add type checks for function calls

This commit is contained in:
James Roseborough
2009-01-28 19:38:36 +00:00
parent 89bcd4f0fa
commit 249b711f9f

View File

@@ -23,6 +23,12 @@ notop = function(a) return not a end
checkallpass('notop',{somenumber})
checkallerrors('notop',{notanumber},'attempt to perform arithmetic on')
-- function call
banner( '()' )
funcop = function(a) return a() end
checkallpass('funcop',{somefunction})
checkallerrors('funcop',{notafunction},'attempt to call')
-- ========= binary ops: .. + - * / % ^ == ~= <= >= < > [] . and or
banner( '..' )
concatop = function(a,b) return a..b end
@@ -140,7 +146,6 @@ banner( 'or' )
orop = function(a,b) return clean(a or b) end
checkallpass('orop',{anylua,anylua})
-- ========= for x in y
banner( 'for x=a,b,c' )
forop = function(a,b,c) for x=a,b,c do end end