When using shadow-cljs 2.27.1, the following compiler warning is emitted.
------ WARNING #1 - :undeclared-var --------------------------------------------
Resource: martian/schema.cljc:128:22
--------------------------------------------------------------------------------
125 | ;patch for `inf` as a default value
126 | (if (and (= schema s/Int) (= default "inf"))
127 | #?(:clj Long/MAX_VALUE
128 | :cljs Number.MAX_SAFE_INTEGER)
----------------------------^---------------------------------------------------
Use of undeclared Var martian.schema/Number
--------------------------------------------------------------------------------
129 | default)]
130 | (st/default schema default))
131 | schema))
132 |
--------------------------------------------------------------------------------
Line 128 should be js/Number.MAX_SAFE_INTEGER instead. Another reason to prefer the js namespace is that these symbols all have their externs inferred.
Dots inside symbols accidentally work as a technical shortcut in ClojureScript, but this is not valid in Clojure. ... Dots inside symbols are not recommended, as they are not detected by :infer-externs.
The function in question
https://github.com/oliyh/martian/blob/b6a3f7698083e9f01c9bcfd46fa90d77a2c76425/core/src/martian/schema.cljc#L124-L133
When using shadow-cljs 2.27.1, the following compiler warning is emitted.
Line 128 should be
js/Number.MAX_SAFE_INTEGER
instead. Another reason to prefer thejs
namespace is that these symbols all have their externs inferred.Per https://cljs.github.io/api/syntax/dot
Also see https://cljs.github.io/api/syntax/js-namespace