Skip to content

Commit 81a1ea1

Browse files
committed
CLJS-2861: Self-host: :checked-arrays not working
1 parent dab61a6 commit 81a1ea1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2267,7 +2267,7 @@
22672267
(throw (error env "set! target must be a field or a symbol naming a var")))
22682268
(cond
22692269
(and (not (:def-emits-var env)) ;; non-REPL context
2270-
(some? ('#{*unchecked-if* *unchecked-array* *warn-on-infer*} target)))
2270+
(some? ('#{*unchecked-if* *unchecked-arrays* *warn-on-infer*} target)))
22712271
{:env env :op :no-op}
22722272

22732273
:else

src/test/cljs/cljs/array_access_test.cljs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
(:require [cljs.test :as test :refer [deftest is]]
1212
[cljs.array-access.alpha :as alpha]))
1313

14+
(deftest cljs-2861-test
15+
;; With cljs-2718, a typo led to (set! *unchecked-arrays* true) as
16+
;; not being treated as a no-op generating intrisic, which we can
17+
;; detect here when this test is run in JVM ClojureScript.
18+
(is (false? *unchecked-arrays*)))
19+
1420
(deftest unchecked-arrays-file-scope-test
1521
(is (not (alpha/unchecked-arrays?))))
1622

0 commit comments

Comments
 (0)