replace vc.get_project_args with vc.get_project_arg & rename table.merge_replace to table.extend

This commit is contained in:
MihailRis 2026-05-31 23:36:24 +03:00
parent b1974405c6
commit d9ae1fe6d4
3 changed files with 5 additions and 3 deletions

View file

@ -57,7 +57,7 @@ function table.merge(t1, t2)
return t1
end
function table.merge_replace(t1, t2)
function table.extend(t1, t2)
for i, v in pairs(t2) do
if type(i) == "number" then
t1[#t1 + 1] = v

View file

@ -302,7 +302,9 @@ require "core:internal/extensions/file"
require "core:internal/extensions/table"
require "core:internal/extensions/string"
vc.get_project_args = table.copy(_vc_project_args)
vc.get_project_arg = function (name)
return _vc_project_args[name]
end
local bytearray = require "core:internal/bytearray"
Bytearray = bytearray.FFIBytearray

View file

@ -1126,7 +1126,7 @@ static int l_gui_load_document(lua::State* L) {
auto env = scripting::create_doc_environment(parentEnv, alias);
// namespace extension
if (lua::istable(L, 4)) {
if (lua::get_from(L, "table", "merge_replace")) {
if (lua::get_from(L, "table", "extend")) {
lua::pushenv(L, *env);
lua::pushvalue(L, 4);
lua::call(L, 2, 0);