Skip to content

Commit 1a537e5

Browse files
committed
tag Node.js vars as 'js to avoid .call invokes
1 parent 3c7c37b commit 1a537e5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,8 @@
10731073
[env sym full-ns current-ns]
10741074
{:name (symbol (str current-ns) (str (munge-node-lib full-ns) "." (name sym)))
10751075
:op :js-var
1076-
:ns current-ns})
1076+
:ns current-ns
1077+
:tag 'js})
10771078

10781079
(defmethod resolve* :global
10791080
[env sym full-ns current-ns]

src/main/clojure/cljs/compiler.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@
11421142
opt-count? (and (= (:name info) 'cljs.core/count)
11431143
(boolean ('#{string array} first-arg-tag)))
11441144
ns (:ns info)
1145-
js? (or (= ns 'js) (= ns 'Math))
1145+
js? (or (= ns 'js) (= ns 'Math) (= tag 'js))
11461146
goog? (when ns
11471147
(or (= ns 'goog)
11481148
(when-let [ns-str (str ns)]

0 commit comments

Comments
 (0)