We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9a1d0c commit 428618bCopy full SHA for 428618b
src/main/cljs/cljs/core.cljs
@@ -12321,9 +12321,11 @@ reduces them without incurring seq initialization"
12321
12322
IAssociative
12323
(-assoc [coll k v]
12324
- (let [new-array (aclone array)]
12325
- (aset new-array k v)
12326
- (Vector. meta new-array nil)))
+ (if (number? k)
+ (let [new-array (aclone array)]
+ (aset new-array k v)
12327
+ (Vector. meta new-array nil))
12328
+ (throw (js/Error. "Vector's key for assoc must be a number."))))
12329
(-contains-key? [coll k]
12330
(if (integer? k)
12331
(and (<= 0 k) (< k (alength array)))
0 commit comments