Skip to content

Commit

Permalink
fix(nodes): Fix calling non-existent nodefactory function (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Nicole committed May 4, 2020
1 parent 0e03bfd commit 9580a15
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/nodefactory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,13 @@ end

setmetatable(nodefactory, {
__index = function (_, prop)
SU.deprecated("SILE.nodefactory." .. prop, "SILE.nodefactory." .. prop:match("n?e?w?(.*)"):lower(), "0.10.0")
local old_constructor = _deprecated_nodefactory[prop]
return string.find(prop, "^new") and old_constructor or old_constructor()
if _deprecated_nodefactory[prop] then
SU.deprecated("SILE.nodefactory." .. prop, "SILE.nodefactory." .. prop:match("n?e?w?(.*)"):lower(), "0.10.0")
local old_constructor = _deprecated_nodefactory[prop]
return string.find(prop, "^new") and old_constructor or old_constructor()
else
SU.error("Attempt to access non-existent SILE.nodefactory." .. prop)
end
end
})

Expand Down

0 comments on commit 9580a15

Please sign in to comment.