From f83fee86de4591a34caf748e41bfbe76b3fbafe2 Mon Sep 17 00:00:00 2001 From: lethosor Date: Mon, 6 Apr 2020 19:12:53 -0400 Subject: [PATCH] Make pairs(df.type) return class methods --- docs/changelog.txt | 3 +++ library/LuaWrapper.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index d8dca022e..34f5c3660 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -42,6 +42,9 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes - `tweak` embark-profile-name: fixed handling of the native shift+space key +## Lua +- ``pairs()`` now returns available class methods for DF types + # 0.47.04-beta1 ## Fixes diff --git a/library/LuaWrapper.cpp b/library/LuaWrapper.cpp index 3b8471d27..497addd5c 100644 --- a/library/LuaWrapper.cpp +++ b/library/LuaWrapper.cpp @@ -1608,8 +1608,8 @@ static void RenderType(lua_State *state, compound_identity *node) lua_dup(state); lua_setfield(state, ix_meta, "__index"); - // pairs table - lua_newtable(state); + // pairs table - reuse index table + lua_dup(state); int ptable = base+4; lua_pushvalue(state, ptable);