diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-10 20:32:51 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-10 20:32:51 +0800 |
commit | cf5c0eaeb60c5610e7b9fe34f1d2df1376cb856d (patch) | |
tree | 009b7f0896c6d60654a153e3297141df45a9b597 /server/test/hover | |
parent | ce9e8a5033dd9ea9bfd2bb2c53af0906e638db28 (diff) | |
download | lua-language-server-cf5c0eaeb60c5610e7b9fe34f1d2df1376cb856d.zip |
穿透pcall与xpcall
Diffstat (limited to 'server/test/hover')
-rw-r--r-- | server/test/hover/init.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua index b144fd72..3d82777d 100644 --- a/server/test/hover/init.lua +++ b/server/test/hover/init.lua @@ -401,3 +401,43 @@ local sssss<utf8>: { offset: function, } ]] + +TEST[[ +function a(v) + print(<?v?>) +end +a(1) +]] +[[ +local v: number = 1 +]] + +TEST[[ +function a(v) + print(<?v?>) +end +pcall(a, 1) +]] +[[ +local v: number = 1 +]] + +TEST[[ +function a(v) + print(<?v?>) +end +xpcall(a, log.error, 1) +]] +[[ +local v: number = 1 +]] + +TEST[[ +function a(v) + return 'a' +end +local _, <?r?> = pcall(a, 1) +]] +[[ +local r: string = "a" +]] |