From 8ae24aa1e450644d56d436772c28582af9ccbad4 Mon Sep 17 00:00:00 2001 From: arichard Date: Tue, 16 Nov 2021 13:35:32 -0800 Subject: fix(pl) import_into using the previous environment's __newindex if set --- CHANGELOG.md | 3 +++ lua/pl/import_into.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32b4198..405fcb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ see [CONTRIBUTING.md](CONTRIBUTING.md#release-instructions-for-a-new-version) fo [#400](https://github.com/lunarmodules/Penlight/pull/400) - fix: `stringx.expandtabs` could error out on Lua 5.3+ [#406](https://github.com/lunarmodules/Penlight/pull/406) + - fix: `pl` the module would not properly forward the `newindex` metamethod + on the global table. + [#395](https://github.com/lunarmodules/Penlight/pull/395) ## 1.11.0 (2021-08-18) diff --git a/lua/pl/import_into.lua b/lua/pl/import_into.lua index 6dd2741..46aaa3e 100644 --- a/lua/pl/import_into.lua +++ b/lua/pl/import_into.lua @@ -50,7 +50,7 @@ return function(env) if prevenvmt then _prev_index = prevenvmt.__index if prevenvmt.__newindex then - gmt.__index = prevenvmt.__newindex + gmt.__newindex = prevenvmt.__newindex end end -- cgit v1.2.3