summaryrefslogtreecommitdiff
path: root/xmake/core/sandbox/sandbox.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-03-26 20:51:35 +0800
committerruki <[email protected]>2016-03-26 20:51:35 +0800
commitf599ffc2ca8f452b70e2fb928816c5b78302ee1b (patch)
tree59cf1fa8ad1cc2a9013641fac59e42d52cabb64e /xmake/core/sandbox/sandbox.lua
parent2d269f2eb8a61c7b4225a766ceedec4fd1858e95 (diff)
modify self interfaces
Diffstat (limited to 'xmake/core/sandbox/sandbox.lua')
-rw-r--r--xmake/core/sandbox/sandbox.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/xmake/core/sandbox/sandbox.lua b/xmake/core/sandbox/sandbox.lua
index dd2dcc23c..637c69ce9 100644
--- a/xmake/core/sandbox/sandbox.lua
+++ b/xmake/core/sandbox/sandbox.lua
@@ -95,8 +95,8 @@ function sandbox._api_register_builtin(self, name, func)
self._PUBLIC[name] = func
end
--- init sandbox
-function sandbox._init()
+-- new a sandbox instance
+function sandbox._new()
-- init an sandbox instance
local instance = {_PUBLIC = {}, _PRIVATE = {}}
@@ -150,14 +150,14 @@ function sandbox._init()
return instance
end
--- make sandbox instance with the given script
-function sandbox.make(script, interp)
+-- new a sandbox instance with the given script
+function sandbox.new(script, interp)
-- check
assert(script and interp)
- -- init self
- local self = sandbox._init()
+ -- new instance
+ local self = sandbox._new()
-- check
assert(self and self._PUBLIC and self._PRIVATE)
@@ -208,7 +208,7 @@ function sandbox.load(script, ...)
end
-- fork a new sandbox from the given sandbox
-function sandbox.fork(self, script)
+function sandbox:fork(script)
-- no script?
if script == nil then
@@ -221,7 +221,7 @@ function sandbox.fork(self, script)
end
-- init a new sandbox instance
- local instance = sandbox._init()
+ local instance = sandbox._new()
-- check
assert(instance and instance._PUBLIC and instance._PRIVATE)
@@ -243,7 +243,7 @@ function sandbox.fork(self, script)
end
-- get script from the given sandbox
-function sandbox.script(self)
+function sandbox:script()
-- check
assert(self and self._PRIVATE)
@@ -253,7 +253,7 @@ function sandbox.script(self)
end
-- get filter from the given sandbox
-function sandbox.filter(self)
+function sandbox:filter()
-- check
assert(self and self._PRIVATE)
@@ -263,7 +263,7 @@ function sandbox.filter(self)
end
-- get root directory from the given sandbox
-function sandbox.rootdir(self)
+function sandbox:rootdir()
-- check
assert(self and self._PRIVATE)