lua: scoreboard iter — trailing-dot numbers, stdlib preload, arg/debug stubs (8x assertion-depth)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-24 19:49:32 +00:00
parent 743e0bae87
commit 781bd36eeb
5 changed files with 72 additions and 56 deletions

View File

@@ -1493,3 +1493,27 @@
(if (>= i (len args))
(list)
(cons (nth args i) (lua-varargs-tail args (+ i 1))))))
;; preload standard libs in package.loaded
(dict-set! __package-loaded "string" string)
(dict-set! __package-loaded "math" math)
(dict-set! __package-loaded "table" table)
(dict-set! __package-loaded "io" io)
(dict-set! __package-loaded "os" os)
(dict-set! __package-loaded "coroutine" coroutine)
(dict-set! __package-loaded "package" package)
(dict-set! __package-loaded "_G" _G)
(define arg {})
;; preload debug stub
(define debug {})
(dict-set! debug "traceback" (fn (&rest args) (if (> (len args) 0) (first args) "")))
(dict-set! debug "getinfo" (fn (&rest args) {}))
(dict-set! debug "sethook" (fn (&rest args) nil))
(dict-set! debug "gethook" (fn () nil))
(dict-set! debug "getlocal" (fn (&rest args) nil))
(dict-set! debug "setlocal" (fn (&rest args) nil))
(dict-set! debug "getupvalue" (fn (&rest args) nil))
(dict-set! debug "setupvalue" (fn (&rest args) nil))
(dict-set! __package-loaded "debug" debug)