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.
(set! a -x false)
1 parent 02b7ead commit 07d2ebcCopy full SHA for 07d2ebc
src/main/clojure/cljs/analyzer.cljc
@@ -2604,7 +2604,7 @@
2604
2605
(defmethod parse 'set!
2606
[_ env [_ target val alt :as form] _ _]
2607
- (let [[target val] (if alt
+ (let [[target val] (if (= 4 (count form))
2608
;; (set! o -prop val)
2609
[`(. ~target ~val) alt]
2610
[target val])]
src/test/cljs/cljs/core_test.cljs
@@ -1987,3 +1987,9 @@
1987
(testing "macroexpanding non-seqs should work"
1988
(is (true? (macroexpand '(and))))
1989
(is (nil? (macroexpand '(or))))))
1990
+
1991
+(deftest test-cljs-3395
1992
+ (testing "(set! foo -bar baz) pattern"
1993
+ (let [a #js {}]
1994
+ (set! a -x false)
1995
+ (is (false? (.-x a))))))
0 commit comments