summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-10-24 00:40:04 +0800
committerruki <[email protected]>2019-10-23 22:00:26 +0800
commit76775e15e26ab1477df1aac77d4d8ed2f92675bd (patch)
treed7acedd9ff15dd725b7e3ae378abd348c4b44d93
parent8ba9f3e6e59f7a1570f1ddece42f499630715a9d (diff)
check api call
-rw-r--r--xmake/core/base/interpreter.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index fe401f262..7aa03a2ca 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -248,6 +248,7 @@ function interpreter:_api_register_xxx_values(scope_kind, action, apifunc, ...)
-- clear the current scope if be not belong to the current scope kind
if scopes._CURRENT and scopes._CURRENT_KIND ~= scope_kind then
+ os.raise("%s() cannot be called in %s(), because it's belong to %s scope!", apiname, scopes._CURRENT_KIND, scope_kind == "__rootkind" and "root" or scope_kind)
scopes._CURRENT = nil
end