Skip to content

Commit 8d248e3

Browse files
mfikesdnolen
authored andcommitted
CLJS-1512: Self-host: arithmetic form meta missing :numeric
In cljs.analyzer/macroexpand-1*, the mac-var is obtained and its meta is checked for :cljs.analyzer/numeric. The problem is that this is a cljs.core/Var obtained from the findInternedVar method on cljs.core/Namespace, which slaps on a degenerate var-meta with the map: {:ns this}. Instead, employ a :cljs conditional branch to to extract the meta out of the compiler metadata.
1 parent 0d52cf2 commit 8d248e3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,12 @@
23582358
sym
23592359
(symbol "cljs.core" (str sym)))
23602360
js-op {:js-op sym}
2361-
js-op (if (true? (-> mac-var meta ::numeric))
2361+
numeric #?(:clj (-> mac-var meta ::numeric)
2362+
:cljs (let [mac-var-ns (symbol (namespace (.-sym mac-var)))
2363+
mac-var-name (symbol (name (.-sym mac-var)))]
2364+
(get-in @env/*compiler*
2365+
[::namespaces mac-var-ns :defs mac-var-name :meta ::numeric])))
2366+
js-op (if (true? numeric)
23622367
(assoc js-op :numeric true)
23632368
js-op)]
23642369
(vary-meta form' merge js-op))

0 commit comments

Comments
 (0)