$ cat src/foo/core.cljs
(ns foo.core)
(prn (time (reduce + (map inc (map inc (range (* 1024 1024)))))))
$ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.516"}}}' -m cljs.main -O advanced -c foo.core
$ node out/main.js
$ cat src/foo/core.cljs
(ns foo.core)
(prn (time (reduce + (map inc (map inc (range (* 1024 1024)))))))
$ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.516"}}}' -m cljs.main -O advanced -c foo.core
$ node out/main.js
| (ns foo.bar | |
| (:require foo.core) | |
| #_(:require-macros foo.core)) | |
| (defn try-me [] | |
| (foo.core/m)) |
| (ns foo.core) | |
| (defmacro m [] | |
| `(foo.core/f)) |
| cljs.user=> (def my-inc (with-meta inc {:a 2})) | |
| #'cljs.user/my-inc | |
| cljs.user=> (my-inc 17) | |
| 18 | |
| cljs.user=> (js/cljs.user.my_inc 17) | |
| cljs.user.my_inc is not a function. (In 'cljs.user.my_inc((17))', 'cljs.user.my_inc' is an instance of MetaFn) | |
| cljs.user=> (def my-inc' (fn [x] (my-inc x))) | |
| #'cljs.user/my-inc' | |
| cljs.user=> (js/cljs.user.my_inc_SINGLEQUOTE_ 17) |
| ClojureScript 1.10.439 | |
| cljs.user=> (defprotocol IFoo | |
| (delete [_])) | |
| false | |
| cljs.user=> (defrecord Foo [] | |
| IFoo | |
| (delete [_] 1)) | |
| cljs.user/Foo | |
| cljs.user=> (delete (->Foo)) | |
| 1 |
Old behavior:
cljs.user=> (defn f [x] (when (even? x) (inc x)))
#'cljs.user/f
cljs.user=> (let [x (f 2)] (if x (+ x "a")))
^
WARNING: cljs.core/+, all arguments must be numbers, got [#{number clj-nil} string] instead at line 1
"3a"
| ClojureScript 1.10.439 | |
| cljs.user=> (require '[clojure.spec.alpha :as s]) | |
| nil | |
| cljs.user=> (require '[clojure.spec.test.alpha :as st]) | |
| nil | |
| cljs.user=> (defn foo [x]) | |
| #'cljs.user/foo | |
| cljs.user=> (s/fdef foo :args (s/cat :x int?)) | |
| cljs.user/foo | |
| cljs.user=> (st/instrument) |
| cljs.user=> (def metas (atom {})) | |
| #'cljs.user/metas | |
| cljs.user=> (extend-type object | |
| #_=> IWithMeta | |
| #_=> (-with-meta [o meta] | |
| #_=> (swap! metas assoc (goog/getUid o) meta) | |
| #_=> o)) | |
| nil | |
| cljs.user=> (extend-type object | |
| #_=> IMeta |
| $ script/test-self-parity | |
| Testing with Node | |
| WARNING: / already refers to: cljs.core// being replaced by: cljs.core-test// at line 625 src/test/cljs/cljs/core_test.cljs | |
| WARNING: Protocol IFn implements method -invoke with variadic signature (&) at line 1397 src/test/cljs/cljs/core_test.cljs | |
| WARNING: baz is a single segment namespace at line 1 src/test/cljs/baz.cljs | |
| WARNING: Namespace static.core-test contains a reserved JavaScript keyword, the corresponding Google Closure namespace will be munged to static$.core_test at line 1 src/test/cljs/static/core_test.cljs | |
| WARNING: Ignoring target object "this" passed in recur to protocol method head at line 24 src/test/cljs/cljs/recur_test.cljs | |
| WARNING: Bad method signature in protocol implementation, IIndexed -nth does not declare arity 1 at line 124 src/test/cljs/cljs/extend_to_native_test.cljs | |
| Testing cljs.eval-test |
| Testing with Node | |
| Testing self-host.test | |
| FAIL in (test-CLJS-1612) (core-self-test.js:942:362) | |
| core macros under syntax quote | |
| expected: (nil? error) | |
| actual: (not (nil? #error {:message "Could not eval ", :data {:tag :cljs/analysis-error}, :cause #error {:message "0 is not ISeqable at line 1 ", :data {:file nil, :line 1, :column 5, :tag :cljs/analysis-error}, :cause #object[Error Error: 0 is not ISeqable]}})) | |
| FAIL in (test-CLJS-1612) (core-self-test.js:942:362) |