Skip to content

Commit

Permalink
chore(classes): Catch and deprecate old inheritance from new classes
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Sep 24, 2020
1 parent 48a1419 commit 6963475
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions classes/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ local base = pl.class({
options = {},

_init = function (self, options)
if options.id then
-- The old std.object inheritence for classes called the base class with
-- and arg of a table which had an ID. Since the new system doesn't have
-- an ID arg, we can assume this is unported code. See also core/sile.lua
-- for deprecation system for the old SILE.baseClass.
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("std.object x", "pl.class", "0.10.10", "0.12.0")
end
if not options then options = {} end
self:declareOption("class", function (name) return name end)
self:declareOption("papersize", function (size)
Expand Down

0 comments on commit 6963475

Please sign in to comment.