File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 12371237
12381238(defmethod emit* :set!
12391239 [{:keys [target val env]}]
1240- (emit-wrap env (emits target " = " val)))
1240+ (emit-wrap env (emits " ( " target " = " val " ) " )))
12411241
12421242(defn emit-global-export [ns-name global-exports lib]
12431243 (emitln (munge ns-name) " ."
Original file line number Diff line number Diff line change 1+ ; ; Copyright (c) Rich Hickey. All rights reserved.
2+ ; ; The use and distribution terms for this software are covered by the
3+ ; ; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
4+ ; ; which can be found in the file epl-v10.html at the root of this distribution.
5+ ; ; By using this software in any fashion, you are agreeing to be bound by
6+ ; ; the terms of this license.
7+ ; ; You must not remove this notice, or any other, from this software.
8+
9+ (ns cljs.specials-test
10+ (:require [cljs.test :refer-macros [deftest is]]))
11+
12+ (defprotocol IFoo3125
13+ (-mutate [this]))
14+
15+ (defrecord Foo3125 [^:mutable x]
16+ IFoo3125
17+ (-mutate [this] (* 3 (set! x (inc x)))))
18+
19+ (def ^:dynamic *test-cljs-3125* 4 )
20+
21+ (deftest test-cljs-3125
22+ (is (== 12 (let [o #js {}] (* 6 (set! (.-a o) 2 )))))
23+ (is (== 12 (let [o #js {}] (* 6 (set! o -a 2 )))))
24+ (is (== 15 (* 3 (set! *test-cljs-3125* (inc *test-cljs-3125*)))))
25+ (is (== 18 (-mutate (->Foo3125 5 )))))
Original file line number Diff line number Diff line change 3737 [cljs.pprint]
3838 [cljs.pprint-test]
3939 [cljs.spec-test]
40+ [cljs.specials-test]
4041 [cljs.spec.test-test]
4142 [cljs.clojure-alias-test]
4243 [cljs.hash-map-test]
8586 'cljs.import-test
8687 'cljs.pprint
8788 'cljs.spec-test
89+ 'cljs.specials-test
8890 'cljs.spec.test-test
8991 'cljs.clojure-alias-test
9092 'cljs.hash-map-test
Original file line number Diff line number Diff line change 303303 [cljs.pprint]
304304 [cljs.pprint-test]
305305 [cljs.spec-test]
306+ [cljs.specials-test]
306307 [cljs.spec.test-test]
307308 [cljs.clojure-alias-test]
308309 [cljs.hash-map-test]
351352 'cljs.pprint
352353 'cljs.pprint-test
353354 'cljs.spec-test
355+ 'cljs.specials-test
354356 'cljs.spec.test-test
355357 'cljs.clojure-alias-test
356358 'cljs.hash-map-test
You can’t perform that action at this time.
0 commit comments