moonscript
moonscript copied to clipboard
Fix to allow debug.upvalue() to set upvalues to nil
This should make it faster (it now stops scanning when it hits the desired upvalue) and more correct. It now allows setting an upvalue to a falsey or nil value, e.g. debug.upvalue(fn, 'foo', nil) (set 'foo' to nil), which is treated differently different from debug.upvalue(fn, 'foo') (get the value of 'foo').