aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/upvalue_func.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2024-05-17 16:38:44 +0800
committerLi Jin <dragon-fly@qq.com>2024-05-17 16:38:44 +0800
commit06bf167924d04aaefe80d6e4ead40989a447ea34 (patch)
treeccd2c3b62797d378ee7cc1872440483d328980ca /spec/outputs/upvalue_func.lua
parentfe317e2bdd9cb60b3c7cd347e21ce65cf90396e7 (diff)
downloadyuescript-0.23.6.tar.gz
yuescript-0.23.6.tar.bz2
yuescript-0.23.6.zip
fix more cases in try-catch syntax.v0.23.6
Diffstat (limited to 'spec/outputs/upvalue_func.lua')
-rw-r--r--spec/outputs/upvalue_func.lua48
1 files changed, 24 insertions, 24 deletions
diff --git a/spec/outputs/upvalue_func.lua b/spec/outputs/upvalue_func.lua
index 5113692..e66eefa 100644
--- a/spec/outputs/upvalue_func.lua
+++ b/spec/outputs/upvalue_func.lua
@@ -367,12 +367,7 @@ local _anon_func_18 = function(print, select, _arg_0, ...)
367 end 367 end
368 end 368 end
369end 369end
370local _anon_func_19 = function(print) 370local _anon_func_19 = function(cond, i)
371 local a = 1
372 print(a + nil)
373 return 1, 2, 3
374end
375local _anon_func_20 = function(cond, i)
376 local _accum_0 = { } 371 local _accum_0 = { }
377 local _len_0 = 1 372 local _len_0 = 1
378 while cond do 373 while cond do
@@ -382,7 +377,7 @@ local _anon_func_20 = function(cond, i)
382 end 377 end
383 return _accum_0 378 return _accum_0
384end 379end
385local _anon_func_21 = function(value) 380local _anon_func_20 = function(value)
386 if 1 == value then 381 if 1 == value then
387 return 'a' 382 return 'a'
388 elseif 2 == value then 383 elseif 2 == value then
@@ -417,27 +412,31 @@ GameEngine:onUpdate(function(deltaTime)
417 func(_anon_func_16(pairs, tb, tostring)) 412 func(_anon_func_16(pairs, tb, tostring))
418 func(_anon_func_17(print)) 413 func(_anon_func_17(print))
419 do 414 do
420 _anon_func_18(print, select, pcall(_anon_func_19, print)) 415 _anon_func_18(print, select, pcall(function()
416 local a = 1
417 print(a + nil)
418 return 1, 2, 3
419 end))
421 end 420 end
422 i = 1 421 i = 1
423 func(_anon_func_20(cond, i)) 422 func(_anon_func_19(cond, i))
424 return func(_anon_func_21(value)) 423 return func(_anon_func_20(value))
425end) 424end)
426local _anon_func_22 = function(cond) 425local _anon_func_21 = function(cond)
427 if cond then 426 if cond then
428 return 998 427 return 998
429 else 428 else
430 return "abc" 429 return "abc"
431 end 430 end
432end 431end
433local _anon_func_23 = function(valueB) 432local _anon_func_22 = function(valueB)
434 if valueB ~= nil then 433 if valueB ~= nil then
435 return valueB 434 return valueB
436 else 435 else
437 return 123 436 return 123
438 end 437 end
439end 438end
440local _anon_func_24 = function(tb) 439local _anon_func_23 = function(tb)
441 if tb ~= nil then 440 if tb ~= nil then
442 local _obj_0 = tb.abc 441 local _obj_0 = tb.abc
443 if _obj_0 ~= nil then 442 if _obj_0 ~= nil then
@@ -451,7 +450,7 @@ local _anon_func_24 = function(tb)
451 end 450 end
452 return nil 451 return nil
453end 452end
454local _anon_func_26 = function(itemA, listA) 453local _anon_func_25 = function(itemA, listA)
455 for _index_0 = 1, #listA do 454 for _index_0 = 1, #listA do
456 if listA[_index_0] == itemA then 455 if listA[_index_0] == itemA then
457 return true 456 return true
@@ -459,17 +458,17 @@ local _anon_func_26 = function(itemA, listA)
459 end 458 end
460 return false 459 return false
461end 460end
462local _anon_func_25 = function(itemA, listA, tb) 461local _anon_func_24 = function(itemA, listA, tb)
463 do 462 do
464 local _call_0 = tb 463 local _call_0 = tb
465 local _call_1 = _call_0["end"](_call_0) 464 local _call_1 = _call_0["end"](_call_0)
466 return _call_1["🤣"](_call_1, 123 and (#listA > 0 and _anon_func_26(itemA, listA))) 465 return _call_1["🤣"](_call_1, 123 and (#listA > 0 and _anon_func_25(itemA, listA)))
467 end 466 end
468end 467end
469GameEngine:onEvent("SomeEvent", function() 468GameEngine:onEvent("SomeEvent", function()
470 return func(value + (_anon_func_22(cond)) + (_anon_func_23(valueB)) > _anon_func_24(tb) + _anon_func_25(itemA, listA, tb)) 469 return func(value + (_anon_func_21(cond)) + (_anon_func_22(valueB)) > _anon_func_23(tb) + _anon_func_24(itemA, listA, tb))
471end) 470end)
472local _anon_func_27 = function(UpdateScoreText, tostring, value) 471local _anon_func_26 = function(UpdateScoreText, tostring, value)
473 if value > 200 then 472 if value > 200 then
474 UpdateScoreText("Win: " .. tostring(value)) 473 UpdateScoreText("Win: " .. tostring(value))
475 return "done" 474 return "done"
@@ -480,7 +479,7 @@ local _anon_func_27 = function(UpdateScoreText, tostring, value)
480end 479end
481GameEngine:schedule(function(deltaTime) 480GameEngine:schedule(function(deltaTime)
482 local value = 123 481 local value = 123
483 return func(_anon_func_27(UpdateScoreText, tostring, value)) 482 return func(_anon_func_26(UpdateScoreText, tostring, value))
484end) 483end)
485GameEngine:schedule(function(deltaTime) 484GameEngine:schedule(function(deltaTime)
486 local value = 123 485 local value = 123
@@ -496,14 +495,14 @@ GameEngine:schedule(function(deltaTime)
496 end 495 end
497 end)()) 496 end)())
498end) 497end)
499local _anon_func_28 = function(char) 498local _anon_func_27 = function(char)
500 local _obj_0 = char.stats.strength 499 local _obj_0 = char.stats.strength
501 if _obj_0 ~= nil then 500 if _obj_0 ~= nil then
502 return _obj_0:ref() 501 return _obj_0:ref()
503 end 502 end
504 return nil 503 return nil
505end 504end
506local _anon_func_29 = function(os, _arg_0, ...) 505local _anon_func_28 = function(os, _arg_0, ...)
507 do 506 do
508 local ok = _arg_0 507 local ok = _arg_0
509 if ok then 508 if ok then
@@ -513,7 +512,7 @@ local _anon_func_29 = function(os, _arg_0, ...)
513 end 512 end
514 end 513 end
515end 514end
516local _anon_func_30 = function(debug_env_after, debug_env_before, env, func) 515local _anon_func_29 = function(debug_env_after, debug_env_before, env, func)
517 debug_env_before(env) 516 debug_env_before(env)
518 func(env) 517 func(env)
519 return debug_env_after(env) 518 return debug_env_after(env)
@@ -523,13 +522,14 @@ do
523 buff_strength = function(char, item) 522 buff_strength = function(char, item)
524 local _obj_0 = item.buffer.strength 523 local _obj_0 = item.buffer.strength
525 if _obj_0 ~= nil then 524 if _obj_0 ~= nil then
526 return _obj_0(_anon_func_28(char)) 525 return _obj_0(_anon_func_27(char))
527 end 526 end
528 return nil 527 return nil
529 end 528 end
529 local debug_env_before, debug_env_after
530 local exe_func 530 local exe_func
531 exe_func = function(func, env) 531 exe_func = function(func, env)
532 return _anon_func_29(os, xpcall(_anon_func_30, function(ex) 532 return _anon_func_28(os, xpcall(_anon_func_29, function(ex)
533 error(ex) 533 error(ex)
534 return ex 534 return ex
535 end, debug_env_after, debug_env_before, env, func)) 535 end, debug_env_after, debug_env_before, env, func))