2021-10-30 04:25:12 +08:00
|
|
|
-- This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
print('testing function calls through API')
|
|
|
|
|
|
|
|
function add(a, b)
|
2021-12-03 07:20:08 +08:00
|
|
|
return a + b
|
|
|
|
end
|
|
|
|
|
|
|
|
local m = { __eq = function(a, b) return a.a == b.a end }
|
|
|
|
|
|
|
|
function create_with_tm(x)
|
|
|
|
return setmetatable({ a = x }, m)
|
2021-10-30 04:25:12 +08:00
|
|
|
end
|
|
|
|
|
2022-06-17 08:52:23 +08:00
|
|
|
local gen = 0
|
|
|
|
function incuv()
|
|
|
|
gen += 1
|
|
|
|
return gen
|
|
|
|
end
|
|
|
|
|
|
|
|
pi = 3.1415926
|
|
|
|
function getpi()
|
|
|
|
return pi
|
|
|
|
end
|
|
|
|
|
2023-04-08 03:56:27 +08:00
|
|
|
function largealloc()
|
|
|
|
table.create(1000000)
|
|
|
|
end
|
|
|
|
|
|
|
|
function oops()
|
|
|
|
return "oops"
|
|
|
|
end
|
|
|
|
|
2021-10-30 04:25:12 +08:00
|
|
|
return('OK')
|