diff --git a/lib/gears/debug.lua b/lib/gears/debug.lua index 9f56e839..f36a8089 100644 --- a/lib/gears/debug.lua +++ b/lib/gears/debug.lua @@ -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. diff --git a/lib/gears/matrix.lua b/lib/gears/matrix.lua index f52d8770..5e6bf756 100644 --- a/lib/gears/matrix.lua +++ b/lib/gears/matrix.lua @@ -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. diff --git a/lib/wibox/drawable.lua b/lib/wibox/drawable.lua index 4ba29c1f..bfcb5832 100644 --- a/lib/wibox/drawable.lua +++ b/lib/wibox/drawable.lua @@ -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) diff --git a/lib/wibox/widget/base.lua b/lib/wibox/widget/base.lua index c930985b..26203581 100644 --- a/lib/wibox/widget/base.lua +++ b/lib/wibox/widget/base.lua @@ -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