-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest.lua
More file actions
51 lines (46 loc) · 897 Bytes
/
test.lua
File metadata and controls
51 lines (46 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
local ltrace = require "ltrace"
function a(arg1, arg2)
local a000 = false
local a111 = 111
local a222 = "222"
local a333 = "333"
local f = function() print("a") end
local t = {
1, 2, 45, 5, 4,672,
submap = {"aa", "bb"},
ff = function()
print("123")
end,
s = "12",
}
nondefined_var = nondefined_var + 1
end
function b()
local bt = {1,5,256,"234", a = {b = "v"}}
local bs = "this is a string"
local bn = 4234239
a("xx", "yy")
end
xpcall(function()
b()
end, function(err)
io.stderr:write(err .. "\n")
io.stderr:write(ltrace.getfulltrace() .. "\n")
--[[
local fullstack = ltrace.getstack()
local list = ltrace.dumpstack(fullstack)
table.foreach(list, function(i, v)
print(v)
end)
--]]
end)
print('-----------------------------')
function xxx(a, b, cb)
local c = a + b
cb(c)
print(ltrace.getfulltrace())
end
function yyy(cb)
xxx(1, 2, cb)
end
yyy(print)