File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 45
45
(def ^:dynamic *cljs-file* nil )
46
46
#?(:clj (def ^:dynamic *unchecked-if* false ))
47
47
(def ^:dynamic *cljs-static-fns* false )
48
+ (def ^:dynamic *fn-invoke-direct* false )
48
49
(def ^:dynamic *cljs-macros-path* " /cljs/core" )
49
50
(def ^:dynamic *cljs-macros-is-classpath* true )
50
51
(def ^:dynamic *cljs-dep-set* (with-meta #{} {:dep-path []}))
Original file line number Diff line number Diff line change 166
166
:pretty-print :print-input-delimiter :pseudo-names :recompile-dependents :source-map
167
167
:source-map-inline :source-map-timestamp :static-fns :target :verbose :warnings
168
168
:emit-constants :ups-externs :ups-foreign-libs :ups-libs :warning-handlers :preloads
169
- :browser-repl :cache-analysis-format :infer-externs :closure-generate-exports :npm-deps })
169
+ :browser-repl :cache-analysis-format :infer-externs :closure-generate-exports :npm-deps
170
+ :fn-invoke-direct })
170
171
171
172
(def string->charset
172
173
{" iso-8859-1" StandardCharsets/ISO_8859_1
2245
2246
; ; we want to warn about NPM dep conflicts before installing the modules
2246
2247
(check-npm-deps opts)
2247
2248
(let [compiler-stats (:compiler-stats opts)
2249
+ static-fns? (or (and (= (:optimizations opts) :advanced )
2250
+ (not (false ? (:static-fns opts))))
2251
+ (:static-fns opts)
2252
+ ana/*cljs-static-fns*)
2248
2253
all-opts (-> opts
2249
2254
maybe-install-node-deps!
2250
2255
add-implicit-options
2266
2271
(assoc :sources (-find-sources source all-opts))))
2267
2272
(binding [comp/*recompiled* (when-not (false ? (:recompile-dependents opts))
2268
2273
(atom #{}))
2269
- ana/*cljs-static-fns*
2270
- (or (and (= (:optimizations opts) :advanced )
2271
- (not (false ? (:static-fns opts))))
2272
- (:static-fns opts)
2273
- ana/*cljs-static-fns*)
2274
+ ana/*cljs-static-fns* static-fns?
2275
+ ana/*fn-invoke-direct* (or (and static-fns?
2276
+ (:fn-invoke-direct opts))
2277
+ ana/*fn-invoke-direct*)
2274
2278
*assert* (not= (:elide-asserts opts) true )
2275
2279
ana/*load-tests* (not= (:load-tests opts) false )
2276
2280
ana/*cljs-warnings*
Original file line number Diff line number Diff line change 1039
1039
(if (and ana/*cljs-static-fns* (= (:op f) :var ))
1040
1040
; ; higher order case, static information missing
1041
1041
(let [fprop (str " .cljs$core$IFn$_invoke$arity$" (count args))]
1042
- (emits " (" f fprop " ? " f fprop " (" (comma-sep args) " ) : " f " .call(" (comma-sep (cons " null" args)) " ))" ))
1043
- (emits f " .call(" (comma-sep (cons " null" args)) " )" ))))))
1042
+ (if ana/*fn-invoke-direct*
1043
+ (emits " (" f fprop " ? " f fprop " (" (comma-sep args) " ) : "
1044
+ f " (" (comma-sep args) " ))" )
1045
+ (emits " (" f fprop " ? " f fprop " (" (comma-sep args) " ) : "
1046
+ f " .call(" (comma-sep (cons " null" args)) " ))" )))
1047
+ (if ana/*fn-invoke-direct*
1048
+ (emits f " (" (comma-sep args) " )" )
1049
+ (emits f " .call(" (comma-sep (cons " null" args)) " )" )))))))
1044
1050
1045
1051
(defmethod emit* :new
1046
1052
[{:keys [ctor args env]}]
You can’t perform that action at this time.
0 commit comments