Skip to content

Commit 6796564

Browse files
author
dnolen
committed
mark bootstrap helpers - note advanced compilation issues in comment
1 parent c805d26 commit 6796564

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10435,9 +10435,15 @@ reduces them without incurring seq initialization"
1043510435
".."
1043610436
(demunge-str (str name))))))
1043710437

10438-
(defn- ns-lookup [ns-obj k]
10438+
;; -----------------------------------------------------------------------------
10439+
;; Bootstrap helpers - incompatible with advanced compilation
10440+
10441+
(defn- ns-lookup
10442+
"Bootstrap only."
10443+
[ns-obj k]
1043910444
(fn [] (gobject/get ns-obj k)))
1044010445

10446+
;; Bootstrap only
1044110447
(deftype Namespace [obj name]
1044210448
Object
1044310449
(findInternedVar [this sym]
@@ -10459,16 +10465,20 @@ reduces them without incurring seq initialization"
1045910465
(hash name)))
1046010466

1046110467
(def
10462-
^{:jsdoc ["@type {*}"]}
10468+
^{:doc "Bootstrap only." :jsdoc ["@type {*}"]}
1046310469
NS_CACHE nil)
1046410470

10465-
(defn- find-ns-obj* [ctxt xs]
10471+
(defn- find-ns-obj*
10472+
"Bootstrap only."
10473+
[ctxt xs]
1046610474
(cond
1046710475
(nil? ctxt) nil
1046810476
(nil? xs) ctxt
1046910477
:else (recur (gobject/get ctxt (first xs)) (next xs))))
1047010478

10471-
(defn find-ns-obj [ns]
10479+
(defn find-ns-obj
10480+
"Bootstrap only."
10481+
[ns]
1047210482
(let [munged-ns (munge (str ns))
1047310483
segs (.split munged-ns ".")]
1047410484
(case *target*
@@ -10487,7 +10497,9 @@ reduces them without incurring seq initialization"
1048710497
"default" (find-ns-obj* goog/global segs)
1048810498
(throw (js/Error. (str "find-ns-obj not supported for target " *target*))))))
1048910499

10490-
(defn ns-interns* [sym]
10500+
(defn ns-interns*
10501+
"Bootstrap only."
10502+
[sym]
1049110503
(let [ns-obj (find-ns-obj sym)
1049210504
ns (Namespace. ns-obj sym)]
1049310505
(letfn [(step [ret k]
@@ -10498,12 +10510,15 @@ reduces them without incurring seq initialization"
1049810510
(reduce step {} (js-keys ns-obj)))))
1049910511

1050010512
(defn create-ns
10513+
"Bootstrap only."
1050110514
([sym]
1050210515
(create-ns sym (find-ns-obj sym)))
1050310516
([sym ns-obj]
1050410517
(Namespace. ns-obj sym)))
1050510518

10506-
(defn find-ns [ns]
10519+
(defn find-ns
10520+
"Bootstrap only."
10521+
[ns]
1050710522
(when (nil? NS_CACHE)
1050810523
(set! NS_CACHE (atom {})))
1050910524
(let [the-ns (get @NS_CACHE ns)]
@@ -10515,7 +10530,9 @@ reduces them without incurring seq initialization"
1051510530
(swap! NS_CACHE assoc ns new-ns)
1051610531
new-ns))))))
1051710532

10518-
(defn find-macros-ns [ns]
10533+
(defn find-macros-ns
10534+
"Bootstrap only."
10535+
[ns]
1051910536
(when (nil? NS_CACHE)
1052010537
(set! NS_CACHE (atom {})))
1052110538
(let [the-ns (get @NS_CACHE ns)]
@@ -10531,5 +10548,7 @@ reduces them without incurring seq initialization"
1053110548
(swap! NS_CACHE assoc ns new-ns)
1053210549
new-ns))))))
1053310550

10534-
(defn ns-name [ns-obj]
10551+
(defn ns-name
10552+
"Bootstrap only."
10553+
[ns-obj]
1053510554
(.-name ns-obj))

0 commit comments

Comments
 (0)