diff options
-rw-r--r-- | script/cli/doc/export.lua | 3 | ||||
-rw-r--r-- | script/cli/doc/init.lua | 7 | ||||
-rw-r--r-- | script/vm/compiler.lua | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/script/cli/doc/export.lua b/script/cli/doc/export.lua index 5a8c3239..7864889e 100644 --- a/script/cli/doc/export.lua +++ b/script/cli/doc/export.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: await-in-sync, param-type-mismatch local ws = require 'workspace' local vm = require 'vm' local guide = require 'parser.guide' @@ -351,4 +352,4 @@ function export.serializeAndExport(docs, outputDir) return true, {jsonPath, mdPath} end -return export
\ No newline at end of file +return export diff --git a/script/cli/doc/init.lua b/script/cli/doc/init.lua index 78a16e9e..483ea21f 100644 --- a/script/cli/doc/init.lua +++ b/script/cli/doc/init.lua @@ -52,8 +52,8 @@ end ---clones a module and assigns any internal upvalues pointing to the module to the new clone ---useful for sandboxing ----@param tbl table module to be cloned ----@return table module_clone the cloned module +---@param tbl any module to be cloned +---@return any module_clone the cloned module local function reinstantiateModule(tbl, _new_module, _old_module, _has_seen) _old_module = _old_module or tbl --remember old module only at root _has_seen = _has_seen or {} --remember visited indecies @@ -78,6 +78,7 @@ local function reinstantiateModule(tbl, _new_module, _old_module, _has_seen) i = i + 1 end local new_func = load(string.dump(func))--, 'function@reinstantiateModule()', 'b', _ENV) + assert(new_func, 'could not load dumped function') for index, upvalue in ipairs(upvalues) do debug.setupvalue(new_func, index, upvalue) end @@ -240,4 +241,4 @@ function doc.runCLI() end) end -return doc
\ No newline at end of file +return doc diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index deab2033..0259947f 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -517,7 +517,7 @@ end ---@param suri uri ---@param object vm.global ---@param key string|number|integer|boolean|vm.global|vm.ANY ----@param pushResult fun(field: vm.object, isMark?: boolean, discardParentFields?: boolean) +---@param pushResult fun(field: vm.object | vm.global, isMark?: boolean, discardParentFields?: boolean) function vm.getSimpleClassFields(suri, object, key, pushResult) local mark = {} local function searchClass(class, searchedFields, discardParentFields) @@ -2318,4 +2318,4 @@ function vm.compileNode(source) local node = vm.getNode(source) ---@cast node -? return node -end
\ No newline at end of file +end |