summaryrefslogtreecommitdiff
path: root/xmake/core/base/deprecated/interpreter.lua
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 /xmake/core/base/deprecated/interpreter.lua
parent7f281a4bcc32519b717f269fd4f2307704f2cd70 (diff)
fix deprecated api bug
Diffstat (limited to 'xmake/core/base/deprecated/interpreter.lua')
-rw-r--r--xmake/core/base/deprecated/interpreter.lua22
1 files changed, 16 insertions, 6 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