diff options
author | Kevin <[email protected]> | 2024-11-04 02:17:00 -0300 |
---|---|---|
committer | Kevin <[email protected]> | 2024-11-04 02:17:00 -0300 |
commit | b697dd8e1d936d6a789c73fbacfc65698d2dab39 (patch) | |
tree | 9d0b59a7e3b515ed52bb89f0d93bafcfc7ed0a46 | |
parent | 5489883e0199632b8aa269ae268739c96c4b272e (diff) |
core: smol lua fixes
-rw-r--r-- | lang/lua/astal/binding.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lang/lua/astal/binding.lua b/lang/lua/astal/binding.lua index 610f3a6..81d2177 100644 --- a/lang/lua/astal/binding.lua +++ b/lang/lua/astal/binding.lua @@ -34,8 +34,9 @@ function Binding:get() return self.transform_fn(self.emitter[self.property]) elseif type(self.emitter.get) == "function" then return self.transform_fn(self.emitter:get()) + else + error("can not get: Not a GObject or a Variable " + self) end - error("can not get: Not a GObject or a Variable " + self) end ---@param transform fun(value: any): any @@ -62,8 +63,9 @@ function Binding:subscribe(callback) return self.emitter:subscribe(function() callback(self:get()) end) + else + error("can not subscribe: Not a GObject or a Variable " + self) end - error("can not subscribe: Not a GObject or a Variable " + self) end Binding.__index = Binding |