Skip to content

Commit

Permalink
chore(classes): Catch and aggressively deprecate old class inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Sep 22, 2020
1 parent 7cb1453 commit b2264f1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/sile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ SILE.frameParser = require("core/frameparser")
SILE.linebreak = require("core/break")
require("core/frame")

-- Class system deprecation shims
SILE.baseClass = {}
local _classdeprecation = function ()
SU.warn([[
The inheritance system for SILE classes has been refactored using a
different object model, please update your code as use of the old
model will cause unexpected errors and will eventually be removed.
]])
SU.deprecated("SILE.baseclass", "SILE.classes.base", "0.10.10", "0.12.0")
end
setmetatable(SILE.baseClass, {
__index = function(_, key)
_classdeprecation()
return SILE.classes.base[key]
end,
__call = function (_, ...)
_classdeprecation()
return SILE.classes.base(...)
end
})

SILE.init = function ()
if not SILE.backend then
if pcall(function () require("justenoughharfbuzz") end) then
Expand Down

0 comments on commit b2264f1

Please sign in to comment.