aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/unicode/try_catch.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
committerLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
commite61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch)
tree6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/outputs/unicode/try_catch.lua
parent289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff)
downloadyuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz
yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2
yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec/outputs/unicode/try_catch.lua')
-rw-r--r--spec/outputs/unicode/try_catch.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/spec/outputs/unicode/try_catch.lua b/spec/outputs/unicode/try_catch.lua
new file mode 100644
index 0000000..fde63d6
--- /dev/null
+++ b/spec/outputs/unicode/try_catch.lua
@@ -0,0 +1,61 @@
1xpcall(_u51fd_u6570, function(_u9519_u8bef)
2 return _u6253_u5370(_u9519_u8bef)
3end, 1, 2, 3)
4xpcall(_u51fd_u6570, function(_u9519_u8bef)
5 return _u6253_u5370(_u9519_u8bef)
6end, 1, 2, 3)
7pcall(function()
8 _u6253_u5370("正在try")
9 return _u51fd_u6570(1, 2, 3)
10end)
11do
12 local _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef)
13 return _u6253_u5370(_u9519_u8bef)
14 end, 1, 2, 3)
15 _u6210_u529f, _u7ed3_u679c = pcall(_u51fd_u6570, 1, 2, 3)
16end
17pcall(_u8868["函数"])
18pcall(_u8868["函数"])
19pcall(_u8868["函数"])
20pcall((_u8868["函数"]))
21pcall(((function()
22 local _base_0 = _u8868
23 local _fn_0 = _base_0["函数"]
24 return _fn_0 and function(...)
25 return _fn_0(_base_0, ...)
26 end
27end)()), 1, 2, 3)
28pcall(_u8868["函数"], 1)
29pcall(_u8868["函数"], 1)
30if (xpcall(_u51fd_u6570, function(_u9519_u8bef)
31 return _u6253_u5370(_u9519_u8bef)
32end, 1)) then
33 _u6253_u5370("好的")
34end
35if xpcall((_u51fd_u6570), function(_u9519_u8bef)
36 return _u6253_u5370(_u9519_u8bef)
37end, 1) then
38 _u6253_u5370("好的")
39end
40do
41 do
42 local _u6210_u529f, _u7ed3_u679c = pcall(_u51fd_u6570, "abc", 123)
43 if _u6210_u529f then
44 _u6253_u5370(_u7ed3_u679c)
45 end
46 end
47 local _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef)
48 return _u6253_u5370(_u9519_u8bef)
49 end, "abc", 123)
50 _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef)
51 return _u6253_u5370(_u9519_u8bef)
52 end, "abc", 123)
53 if _u6210_u529f then
54 _u6253_u5370(_u7ed3_u679c)
55 end
56end
57do
58pcall(_u51fd_u6570, 1, 2, 3)
59pcall(_u51fd_u6570, 1, 2, 3)
60end
61return nil