Browse Source

null is object, not undefined

tags/0.4.0^2
rucciva noneedtoknow 9 months ago
parent
commit
76d828faf8
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      logic.lua

+ 5
- 1
logic.lua View File

@@ -493,7 +493,11 @@ operations['length'] = function(_, obj)
return 0
end

operations['typeof'] = function(_, v)
operations['typeof'] = function(closure, v)
if closure.opts.null == v then
return 'object'
end

local t = type(v)
if t == 'nil' then
return 'undefined'

Loading…
Cancel
Save