We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80c77a2 commit d5e8da2Copy full SHA for d5e8da2
src/main/clojure/cljs/core.cljc
@@ -960,11 +960,12 @@
960
(core/defmacro string? [x]
961
(bool-expr (core/list 'js* "typeof ~{} === 'string'" x)))
962
963
-;; TODO: x must be a symbol, not an arbitrary expression
964
(core/defmacro exists?
965
"Return true if argument exists, analogous to usage of typeof operator
966
- in JavaScript."
+ in JavaScript to check for undefined top-level var. x must be a symbol but
+ need not be top-level."
967
[x]
968
+ (core/assert (core/symbol? x))
969
(let [x (cond-> (:name (cljs.analyzer/resolve-var &env x))
970
(= "js" (namespace x)) name)
971
segs (string/split (core/str (string/replace x #"\/" ".")) #"\.")
0 commit comments