Merge pull request #454 from psychon/remove_gears.debug.assert
Remove gears.debug.assert Closes https://github.com/awesomeWM/awesome/pull/454. Conflicts: lib/gears/matrix.lua
This commit is contained in:
commit
28ffdb050e
|
@ -14,17 +14,6 @@ local pairs = pairs
|
|||
|
||||
local debug = {}
|
||||
|
||||
--- Check that the given condition holds true, else throw an error
|
||||
--
|
||||
-- @param cond If this is false, throw a lua error with a backtrace.
|
||||
-- @param[opt] message Message to print in the error.
|
||||
function debug.assert(cond, message)
|
||||
local message = message or cond
|
||||
if not cond then
|
||||
error(traceback("Assertion failed: '" .. tostring(message) .. "'"))
|
||||
end
|
||||
end
|
||||
|
||||
--- Given a table (or any other data) return a string that contains its
|
||||
-- tag, value and type. If data is a table then recursively call `dump_raw`
|
||||
-- on each of its values.
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
---------------------------------------------------------------------------
|
||||
|
||||
local cairo = require("lgi").cairo
|
||||
local debug = require("gears.debug")
|
||||
local matrix = {}
|
||||
|
||||
-- Metatable for matrix instances. This is set up near the end of the file.
|
||||
|
|
|
@ -15,7 +15,6 @@ local capi = {
|
|||
local beautiful = require("beautiful")
|
||||
local cairo = require("lgi").cairo
|
||||
local color = require("gears.color")
|
||||
local debug = require("gears.debug")
|
||||
local object = require("gears.object")
|
||||
local sort = require("gears.sort")
|
||||
local surface = require("gears.surface")
|
||||
|
@ -133,7 +132,7 @@ local function do_redraw(self)
|
|||
|
||||
self.drawable:refresh()
|
||||
|
||||
debug.assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status)
|
||||
assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status)
|
||||
end
|
||||
|
||||
local function find_widgets(drawable, result, hierarchy, x, y)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
-- @module wibox.widget.base
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
local debug = require("gears.debug")
|
||||
local object = require("gears.object")
|
||||
local cache = require("gears.cache")
|
||||
local matrix = require("gears.matrix")
|
||||
|
@ -423,9 +422,9 @@ end
|
|||
--- Do some sanity checking on widget. This function raises a lua error if
|
||||
-- widget is not a valid widget.
|
||||
function base.check_widget(widget)
|
||||
debug.assert(type(widget) == "table")
|
||||
assert(type(widget) == "table")
|
||||
for k, func in pairs({ "add_signal", "connect_signal", "disconnect_signal" }) do
|
||||
debug.assert(type(widget[func]) == "function", func .. " is not a function")
|
||||
assert(type(widget[func]) == "function", func .. " is not a function")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue