summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/main.lua2
-rw-r--r--server/src/service.lua2
-rw-r--r--server/src/vm/vm.lua14
3 files changed, 16 insertions, 2 deletions
diff --git a/server/main.lua b/server/main.lua
index dd0c53d3..1895f804 100644
--- a/server/main.lua
+++ b/server/main.lua
@@ -21,7 +21,7 @@ local function tryDebugger()
log.info('Debugger startup, listen port: 11411')
end
-pcall(tryDebugger)
+--pcall(tryDebugger)
require 'utility'
require 'global_protect'
diff --git a/server/src/service.lua b/server/src/service.lua
index bd8f1216..5b7465d3 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -359,7 +359,7 @@ function mt:compileAst(obj)
log.debug(message)
rpc:notify('window/showMessage', {
type = 3,
- message = lang.script('PARSER_CRASH', err:match 'grammar%.lua%:%d+%:(.+)' or err),
+ message = lang.script('PARSER_CRASH', err:match '%.lua%:%d+%:(.+)' or err),
})
if message:find 'not enough memory' then
self:restartDueToMemoryLeak()
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 2a223d42..dfdac390 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -278,6 +278,20 @@ function mt:callLibrary(func, values, source, lib)
elseif lib.special == 'seeall' then
self:callSeeAll(func, values)
end
+ else
+ -- 如果lib的参数中有function,则立即执行function
+ if lib.args then
+ local args
+ for i = 1, #lib.args do
+ local value = values[i]
+ if value and value:getFunction() then
+ if not args then
+ args = createMulti()
+ end
+ self:call(value, args, source)
+ end
+ end
+ end
end
end