diff options
| author | Albert Krewinkel <albert@zeitkraut.de> | 2023-03-15 20:49:49 +0100 |
|---|---|---|
| committer | Albert Krewinkel <albert@zeitkraut.de> | 2023-03-15 20:57:45 +0100 |
| commit | b5b9edf5645277c11fd9d3a9300c74a7f08434f5 (patch) | |
| tree | a37127f10bda99b6f47fefaf0e1c333fff0dce44 /pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs | |
| parent | 369e7b52e81735695d206d8f23308f96d39e0986 (diff) | |
Lua: keep the Lua stack clean
A metatable used during initialization was not properly removed from the
stack. Likewise, accessing the CommonState from Lua previously led to
the pollution of the Lua stack with a left-over value.
Diffstat (limited to 'pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs')
| -rw-r--r-- | pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs index aa501fbaf..247b70add 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Init.hs @@ -188,6 +188,7 @@ initLuaState = do initJsonMetatable :: PandocLua () initJsonMetatable = liftPandocLua $ do newListMetatable HsLua.Aeson.jsonarray (pure ()) + Lua.pop 1 -- | Evaluate a @'PandocLua'@ computation, running all contained Lua -- operations. |
