summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-05-27 22:01:53 +0800
committerruki <[email protected]>2016-05-27 22:01:53 +0800
commit125c23d12e9983234c328b805c8da5b8f78ab898 (patch)
tree2a1b05ef213f880a66f3d083fd09d38c51fbe963
parent7f281a4bcc32519b717f269fd4f2307704f2cd70 (diff)
fix deprecated api bug
-rw-r--r--xmake/core/base/deprecated/interpreter.lua22
-rw-r--r--xmake/core/base/interpreter.lua8
2 files changed, 23 insertions, 7 deletions
diff --git a/xmake/core/base/deprecated/interpreter.lua b/xmake/core/base/deprecated/interpreter.lua
index 6f94296a3..410841ef6 100644
--- a/xmake/core/base/deprecated/interpreter.lua
+++ b/xmake/core/base/deprecated/interpreter.lua
@@ -152,13 +152,18 @@ function deprecated_interpreter:_api_register_set_xxx_xxx(scope_kind, apiname)
assert(apifunc)
-- register api
- self:api_register(nil, oldapi, function (...)
+ self:api_register_builtin(oldapi, function (value, ...)
+
+ -- check
+ if type(value) ~= "string" then
+ value = type(value)
+ end
-- deprecated
- deprecated.add(newapi .. "()", oldapi .. "()")
+ deprecated.add(newapi .. "(\"%s\")", oldapi .. "(\"%s\")", value)
-- dispatch it
- apifunc(...)
+ apifunc(value, ...)
end)
end
@@ -176,13 +181,18 @@ function deprecated_interpreter:_api_register_add_xxx_xxx(scope_kind, apiname)
assert(apifunc)
-- register api
- self:api_register(nil, oldapi, function (...)
+ self:api_register_builtin(oldapi, function (value, ...)
+
+ -- check
+ if type(value) ~= "string" then
+ value = type(value)
+ end
-- deprecated
- deprecated.add(newapi .. "()", oldapi .. "()")
+ deprecated.add(newapi .. "(\"%s\")", oldapi .. "(\"%s\")", value)
-- dispatch it
- apifunc(...)
+ apifunc(value, ...)
end)
end
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index dd5e7c45f..89384dfb4 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -517,7 +517,13 @@ function interpreter:load(file, scope_kind, remove_repeat, enable_filter)
end
-- make results
- return self:_make(scope_kind, remove_repeat, enable_filter)
+ local ok, results = xpcall(interpreter._make, interpreter._traceback, self, scope_kind, remove_repeat, enable_filter)
+ if not ok then
+ return nil, results
+ end
+
+ -- ok
+ return results
end
-- get mtimes