tables containing functions will break the debugger
ARaccoonNamedDEF opened this issue · 3 comments
ARaccoonNamedDEF commented
When you try to use the wire debugger on an Expression 2 chip that has a table that contains a function, the debugger will break permanently.
Here's an Expression 2 chip I wrote that should reproduce this:
@outputs Table:table
Table = table()
Table["Speak",function] = function() {
print("Hi")
}
This is the console error I've gotten:
[wire] entities/gmod_wire_expression2/core/table.lua:82: attempt to call a nil value
1. temp - entities/gmod_wire_expression2/core/table.lua:82
2. unknown - entities/gmod_wire_expression2/core/table.lua:106
3. updateForPlayer - addons/wire/lua/weapons/gmod_tool/stools/wire_debugger.lua:298
4. unknown - addons/wire/lua/weapons/gmod_tool/stools/wire_debugger.lua:328
Timer Failed! [Wire_DebuggerThink][@addons/wire/lua/weapons/gmod_tool/stools/wire_debugger.lua (line 332)]
Denneisk commented
Yeah don't output tables containing functions or functions, or have them in a subtable if you so need them.
I believe this is because functions don't have a function for the debugger to represent them as a string.
thegrb93 commented
The debugger should still be fixed to not error
Denneisk commented
Of course, sorry to imply that it shouldn't be fixed. It's just that the usage seems uncommon.