Skip to content

Commit f95a13b

Browse files
committed
CLJS-3227: :bundle target breaks ^:export
add a new *global* goog-define, only support the obvious cases
1 parent b58b5ff commit f95a13b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
:closure-defines option."}
4848
*target* "default")
4949

50+
(goog-define
51+
^{:dynamic true
52+
:doc "Manually set the JavaScript global context. Only \"window\", \"self\"
53+
, and \"global\" supported. "}
54+
*global* "default")
55+
5056
(def
5157
^{:dynamic true
5258
:doc "Var bound to the current namespace. Only used for bootstrapping."
@@ -11739,4 +11745,8 @@ reduces them without incurring seq initialization"
1173911745

1174011746
(when ^boolean js/COMPILED
1174111747
(when (identical? "nodejs" *target*)
11742-
(set! goog/global js/global)))
11748+
(set! goog/global js/global))
11749+
(cond
11750+
(identical? "window" *global*) (set! goog/global js/window)
11751+
(identical? "self" *global*) (set! goog/global js/self)
11752+
(identical? "global" *global*) (set! goog/global js/global)))

0 commit comments

Comments
 (0)