Skip to content

Commit f948316

Browse files
thhellerdnolen
authored andcommitted
fix some signature errors uncovered by closure :check-types
IndexedSeq is off by one, missing the metadata .createAsIfByAssoc calls were providing undeclared extra arguments
1 parent 355c20e commit f948316

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8336,7 +8336,7 @@ reduces them without incurring seq initialization"
83368336
(let [arr (if (and (instance? IndexedSeq keyvals) (zero? (.-i keyvals)))
83378337
(.-arr keyvals)
83388338
(into-array keyvals))]
8339-
(.createAsIfByAssoc PersistentArrayMap arr true false)))
8339+
(.createAsIfByAssoc PersistentArrayMap arr)))
83408340

83418341
(defn obj-map
83428342
"keyval => key val

src/main/clojure/cljs/compiler.cljc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
(emits "new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, " (count items) ", ["
409409
(comma-sep (interleave items (repeat "null"))) "], null), null)")
410410

411-
:else (emits "cljs.core.PersistentHashSet.createAsIfByAssoc([" (comma-sep items) "], true)"))))
411+
:else (emits "cljs.core.PersistentHashSet.createAsIfByAssoc([" (comma-sep items) "])"))))
412412

413413
(defmethod emit* :js-value
414414
[{:keys [items js-type env]}]
@@ -565,7 +565,7 @@
565565
:else line))
566566

567567
(defn checking-types? []
568-
(#{:error :warn}
568+
(#{:error :warning}
569569
(get-in @env/*compiler*
570570
[:options :closure-warnings :check-types])))
571571

@@ -750,7 +750,7 @@
750750
(emitln " = null;")
751751
(emitln "if (arguments.length > " (dec (count params)) ") {")
752752
(let [a (emit-arguments-to-array (dec (count params)))]
753-
(emitln " " (last params) " = new cljs.core.IndexedSeq(" a ",0);"))
753+
(emitln " " (last params) " = new cljs.core.IndexedSeq(" a ",0,null);"))
754754
(emitln "} "))
755755
(emits "return " delegate-name ".call(this,")
756756
(doseq [param params]
@@ -819,7 +819,7 @@
819819
(emitln "var " restarg " = null;")
820820
(emitln "if (arguments.length > " max-fixed-arity ") {")
821821
(let [a (emit-arguments-to-array max-fixed-arity)]
822-
(emitln restarg " = new cljs.core.IndexedSeq(" a ",0);"))
822+
(emitln restarg " = new cljs.core.IndexedSeq(" a ",0,null);"))
823823
(emitln "}")
824824
(emitln "return " n ".cljs$core$IFn$_invoke$arity$variadic("
825825
(comma-sep (butlast maxparams))

0 commit comments

Comments
 (0)