Skip to content

Commit 429d7ca

Browse files
committed
Vector ILookup and IFn issues
- -lookup needs to use nil so it doesn't throw - -invoke should not take extra parameter, just copy PersistentVector implementation - clojure.data-test passing now
1 parent 48d6340 commit 429d7ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12372,7 +12372,7 @@ reduces them without incurring seq initialization"
1237212372
ILookup
1237312373
(-lookup [coll k]
1237412374
(when (number? k)
12375-
(-nth coll k)))
12375+
(-nth coll k nil)))
1237612376
(-lookup [coll k not-found]
1237712377
(if (number? k)
1237812378
(-nth coll k not-found)
@@ -12424,9 +12424,9 @@ reduces them without incurring seq initialization"
1242412424

1242512425
IFn
1242612426
(-invoke [coll k]
12427-
(-lookup coll k))
12428-
(-invoke [coll k not-found]
12429-
(-lookup coll k not-found))
12427+
(if (number? k)
12428+
(-nth coll k)
12429+
(throw (js/Error. "Key must be integer"))))
1243012430

1243112431
IEditableCollection
1243212432
(-as-transient [coll]

src/test/cljs/lite_test_runner.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
'cljs.ns-test
8888
'clojure.set-test
8989
'clojure.string-test
90-
#_'clojure.data-test ;; 1 failure #object[Error Error: No item 1 in vector of length 1]
90+
'clojure.data-test
9191
'clojure.datafy-test
9292
'clojure.edn-test
9393
'clojure.walk-test

0 commit comments

Comments
 (0)