extensions/magic_sandbox: Never wrap nil into a sandbox wrapper instance (it's very confusing)

This commit is contained in:
Perttu Ahola 2014-10-03 12:43:13 +03:00
parent f1371650b9
commit 92f63f2bbb

View File

@ -15,6 +15,9 @@ function M.wrap_class(type_name, def)
class_meta.inherited_from_in_sandbox = def.inherited_from_in_sandbox class_meta.inherited_from_in_sandbox = def.inherited_from_in_sandbox
class_meta.inherited_from_by_wrapper = def.inherited_from_by_wrapper class_meta.inherited_from_by_wrapper = def.inherited_from_by_wrapper
class_meta.wrap = function(unsafe) class_meta.wrap = function(unsafe)
if unsafe == nil then
error("magic_sandbox: class_meta.wrap(): Wrapping nil is not allowed")
end
local safe = {} local safe = {}
local meta = { local meta = {
unsafe = unsafe, unsafe = unsafe,