summaryrefslogtreecommitdiff
path: root/server/src/vm/local.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/vm/local.lua')
-rw-r--r--server/src/vm/local.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/src/vm/local.lua b/server/src/vm/local.lua
index f5e65e83..106606ea 100644
--- a/server/src/vm/local.lua
+++ b/server/src/vm/local.lua
@@ -1,6 +1,7 @@
local sourceMgr = require 'vm.source'
local Sort = 0
+local Watch = setmetatable({}, {__mode = 'kv'})
local mt = {}
mt.__index = mt
@@ -137,7 +138,7 @@ function mt:getSource()
return sourceMgr.list[self.source]
end
-return function (name, source, value)
+local function create(name, source, value)
if not value then
error('Local must has a value')
end
@@ -154,5 +155,11 @@ return function (name, source, value)
value = value,
_info = {},
}, mt)
+ Watch[self] = true
return self
end
+
+return {
+ create = create,
+ watch = Watch,
+}