From 60a1d2f27d044bd668adbc5ac8bfc1f86d8f5d8f Mon Sep 17 00:00:00 2001 From: SX Date: Sun, 14 Mar 2021 18:32:43 +0200 Subject: [PATCH] Spy.on override target __newindex --- src/spy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spy.lua b/src/spy.lua index eb7fc06..4aace9f 100644 --- a/src/spy.lua +++ b/src/spy.lua @@ -90,7 +90,7 @@ spy = { on = function(target_table, target_key) local s = spy.new(target_table[target_key]) - target_table[target_key] = s + rawset(target_table, target_key, s) -- store original data s.target_table = target_table s.target_key = target_key