summaryrefslogtreecommitdiff
path: root/server-beta/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/core')
-rw-r--r--server-beta/src/core/diagnostics/ambiguity-1.lua1
-rw-r--r--server-beta/src/core/diagnostics/init.lua7
-rw-r--r--server-beta/src/core/diagnostics/undefined-global.lua6
3 files changed, 10 insertions, 4 deletions
diff --git a/server-beta/src/core/diagnostics/ambiguity-1.lua b/server-beta/src/core/diagnostics/ambiguity-1.lua
index 1ebb0d8a..37815fb5 100644
--- a/server-beta/src/core/diagnostics/ambiguity-1.lua
+++ b/server-beta/src/core/diagnostics/ambiguity-1.lua
@@ -57,7 +57,6 @@ return function (uri, callback)
and second.type ~= 'unary'
and not first.op
and literalMap[second[1].type]
- and not literalMap[second[2].type]
then
callback {
start = source.start,
diff --git a/server-beta/src/core/diagnostics/init.lua b/server-beta/src/core/diagnostics/init.lua
index 2972694d..2724387d 100644
--- a/server-beta/src/core/diagnostics/init.lua
+++ b/server-beta/src/core/diagnostics/init.lua
@@ -1,6 +1,7 @@
local files = require 'files'
local define = require 'proto.define'
local config = require 'config'
+local await = require 'await'
local function check(uri, name, level, results)
if config.config.diagnostics.disable[name] then
@@ -8,11 +9,17 @@ local function check(uri, name, level, results)
end
level = config.config.diagnostics.severity[name] or level
local severity = define.DiagnosticSeverity[level]
+ local clock = os.clock()
require('core.diagnostics.' .. name)(uri, function (result)
result.level = severity or result.level
result.code = name
results[#results+1] = result
end, name)
+ local passed = os.clock() - clock
+ if passed >= 0.1 then
+ log.warn(('Diagnostics [%s] @ [%s] takes [%.3f] sec!'):format(name, uri, passed))
+ await.delay()
+ end
end
return function (uri)
diff --git a/server-beta/src/core/diagnostics/undefined-global.lua b/server-beta/src/core/diagnostics/undefined-global.lua
index 8476df61..586a9955 100644
--- a/server-beta/src/core/diagnostics/undefined-global.lua
+++ b/server-beta/src/core/diagnostics/undefined-global.lua
@@ -44,14 +44,14 @@ return function (uri, callback)
end
if info.mode == 'get' and not hasSet[source] then
local message
- local otherVersion = library.other[key]
- local customVersion = library.custom[key]
+ local otherVersion = library.other[skey]
+ local customVersion = library.custom[skey]
if otherVersion then
message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_VERSION', table.concat(otherVersion, '/'), config.config.runtime.version))
elseif customVersion then
message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_CUSTOM', table.concat(customVersion, '/')))
else
- message = lang.script('DIAG_UNDEF_GLOBAL', info.key)
+ message = lang.script('DIAG_UNDEF_GLOBAL', skey)
end
callback {
start = source.start,