Skip to content

Commit 47cd1ce

Browse files
anmonteirodnolen
authored andcommitted
CLJS-1942: Self-host: cljs.env.macros and cljs.analyzer.macros can't be loaded
1 parent ff0b11c commit 47cd1ce

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

src/main/clojure/cljs/analyzer/macros.clj

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,32 @@
77
; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.analyzer.macros
10-
(:refer-clojure :exclude [binding])
11-
(:require [cljs.core :refer [binding]]))
10+
(:refer-clojure :exclude [binding]))
1211

1312
(defmacro with-warning-handlers [handlers & body]
14-
`(binding [cljs.analyzer/*cljs-warning-handlers* ~handlers]
13+
`(cljs.core/binding [cljs.analyzer/*cljs-warning-handlers* ~handlers]
1514
~@body))
1615

1716
(defmacro no-warn [& body]
18-
`(binding [cljs.analyzer/*cljs-warnings*
19-
(zipmap (keys cljs.analyzer/*cljs-warnings*) (repeat false))]
17+
`(cljs.core/binding [cljs.analyzer/*cljs-warnings*
18+
(zipmap (keys cljs.analyzer/*cljs-warnings*) (repeat false))]
2019
~@body))
2120

2221
(defmacro with-core-macros
2322
[path & body]
2423
`(do
2524
(when (not= cljs.analyzer/*cljs-macros-path* ~path)
2625
(reset! cljs.analyzer/-cljs-macros-loaded false))
27-
(binding [cljs.analyzer/*cljs-macros-path* ~path]
26+
(cljs.core/binding [cljs.analyzer/*cljs-macros-path* ~path]
2827
~@body)))
2928

3029
(defmacro with-core-macros-file
3130
[path & body]
3231
`(do
3332
(when (not= cljs.analyzer/*cljs-macros-path* ~path)
3433
(reset! cljs.analyzer/-cljs-macros-loaded false))
35-
(binding [cljs.analyzer/*cljs-macros-path* ~path
36-
cljs.analyzer/*cljs-macros-is-classpath* false]
34+
(cljs.core/binding [cljs.analyzer/*cljs-macros-path* ~path
35+
cljs.analyzer/*cljs-macros-is-classpath* false]
3736
~@body)))
3837

3938
(defmacro wrapping-errors [env & body]
@@ -45,13 +44,13 @@
4544
(throw (cljs.analyzer/error ~env (.-message err#) err#))))))
4645

4746
(defmacro disallowing-recur [& body]
48-
`(binding [cljs.analyzer/*recur-frames*
49-
(cons nil cljs.analyzer/*recur-frames*)]
47+
`(cljs.core/binding [cljs.analyzer/*recur-frames*
48+
(cons nil cljs.analyzer/*recur-frames*)]
5049
~@body))
5150

5251
(defmacro allowing-redef [& body]
53-
`(binding [cljs.analyzer/*allow-redef* true]
52+
`(cljs.core/binding [cljs.analyzer/*allow-redef* true]
5453
~@body))
5554

5655
(defmacro disallowing-ns* [& body]
57-
`(binding [cljs.analyzer/*allow-ns* false] ~@body))
56+
`(cljs.core/binding [cljs.analyzer/*allow-ns* false] ~@body))

src/main/clojure/cljs/compiler/macros.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.compiler.macros
10-
(:refer-clojure :exclude [let])
11-
(:require [cljs.core :refer [let]]))
10+
(:refer-clojure :exclude [let]))
1211

1312
(defmacro emit-wrap [env & body]
14-
`(let [env# ~env]
13+
`(cljs.core/let [env# ~env]
1514
(when (= :return (:context env#)) (cljs.compiler/emits "return "))
1615
~@body
17-
(when-not (= :expr (:context env#)) (cljs.compiler/emitln ";"))))
16+
(when-not (= :expr (:context env#)) (cljs.compiler/emitln ";"))))

src/main/clojure/cljs/env/macros.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
; You must not remove this notice, or any other, from this software.
88

99
(ns cljs.env.macros
10-
(:refer-clojure :exclude [binding ensure])
11-
(:require [cljs.core :refer [binding]]))
10+
(:refer-clojure :exclude [binding ensure]))
1211

1312
(defmacro with-compiler-env
1413
"Evaluates [body] with [env] bound as the value of the `*compiler*` var in
@@ -23,7 +22,7 @@
2322
(js/Error.
2423
(str "Compiler environment must be a map or atom containing a map, not "
2524
(type env#)))))]
26-
(binding [cljs.env/*compiler* env#]
25+
(cljs.core/binding [cljs.env/*compiler* env#]
2726
~@body)))
2827

2928
(defmacro ensure
@@ -35,4 +34,4 @@
3534
~@body
3635
(finally
3736
(when (nil? val#)
38-
(set! cljs.env/*compiler* nil))))))
37+
(set! cljs.env/*compiler* nil))))))

src/test/self/self_parity/test.cljs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@
171171
[name macros]
172172
((if macros
173173
#{'cljs.core
174-
'cljs.pprint
175-
'cljs.env.macros
176-
'cljs.analyzer.macros
177-
'cljs.compiler.macros}
174+
'cljs.pprint}
178175
#{'goog.object
179176
'goog.string
180177
'goog.string.StringBuffer

0 commit comments

Comments
 (0)