js-on-sx: typeof <ident> returns "undefined" for unresolvable references
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s
This commit is contained in:
@@ -225,6 +225,20 @@
|
||||
(js-transpile (nth arg 1))
|
||||
(js-transpile (nth arg 2))))
|
||||
(else true)))
|
||||
((and (= op "typeof") (js-tag? arg "js-ident"))
|
||||
(let
|
||||
((name (nth arg 1)))
|
||||
(list
|
||||
(js-sym "if")
|
||||
(list
|
||||
(js-sym "or")
|
||||
(list
|
||||
(js-sym "env-has?")
|
||||
(list (js-sym "current-env"))
|
||||
name)
|
||||
(list (js-sym "dict-has?") (js-sym "js-global") name))
|
||||
(list (js-sym "js-typeof") (js-transpile arg))
|
||||
"undefined")))
|
||||
(else
|
||||
(let
|
||||
((a (js-transpile arg)))
|
||||
|
||||
Reference in New Issue
Block a user