File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 213
213
#?(:clj
214
214
(defmethod emit-constant Double [x] (emits x))
215
215
:cljs
216
- (defmethod emit-constant js /Number [x] (emits x )))
216
+ (defmethod emit-constant js /Number [x] (emits " ( " x " ) " )))
217
217
218
218
#?(:clj
219
219
(defmethod emit-constant BigDecimal [x] (emits (.doubleValue ^BigDecimal x))))
Original file line number Diff line number Diff line change 71
71
(cljs/compile-str st " (+ 1 1)"
72
72
(fn [{:keys [error value]}]
73
73
(is (nil? error))
74
- (is (= " (1 + 1 );\n " value))
74
+ (is (= " ((1) + (1) );\n " value))
75
75
(inc! l)))
76
76
(cljs/compile-str st " (fn [])" nil
77
77
{:context :expr }
83
83
{:context :expr }
84
84
(fn [{:keys [error value]}]
85
85
(is (nil? error))
86
- (is (= " (cljs.core.truth_(cljs.core.first)?1:2 )" value))
86
+ (is (= " (cljs.core.truth_(cljs.core.first)?(1):(2) )" value))
87
87
(inc! l)))
88
88
(cljs/compile-str st " (.toString \" a\" )" nil
89
89
{:context :expr }
95
95
{:context :expr }
96
96
(fn [{:keys [error value]}]
97
97
(is (nil? error))
98
- (is (string/index-of value " cljs.user.foo.call(null,1,2 )" ))
98
+ (is (string/index-of value " cljs.user.foo.call(null,(1),(2) )" ))
99
99
(inc! l)))
100
100
(cljs/compile-str st " (do (defn foo [a b] (+ a b)) (foo 1 2))" nil
101
101
{:context :expr
102
102
:static-fns true }
103
103
(fn [{:keys [error value]}]
104
104
(is (nil? error))
105
- (is (string/index-of value " cljs.user.foo(1,2 )" ))
105
+ (is (string/index-of value " cljs.user.foo((1),(2) )" ))
106
106
(inc! l))))))
107
107
108
108
(deftest test-eval-str
197
197
(is (nil? error))
198
198
(inc! l))))))
199
199
200
+ (deftest test-CLJS-1330
201
+ (cljs/eval-str st
202
+ " (.toString 1)"
203
+ nil
204
+ {:eval node-eval}
205
+ (fn [{:keys [error value]}]
206
+ (is (= " 1" value)))))
207
+
200
208
#_(deftest test-eval-str-with-require
201
209
(async done
202
210
(let [l (latch 3 done)]
You can’t perform that action at this time.
0 commit comments