<< Back to previous view

[CLJS-2259] Extra .cljs_node_repl directory containing cljs.core output Created: 18/Jul/17  Updated: 26/Jul/17

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.456
Fix Version/s: Next

Type: Defect Priority: Critical
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: regression

Approval: Vetted

 Description   

Presuming this is a regression: Starting with 1.9.456, with the shipping cljs.jar, you end up with an extra .cljs_node_repl subdirectory inside the top-level .cljs_node_repl directory (and this appears to be where the analyzer things core symbols reside).

Minimal repro (note the paths in the stacktrace):

$ java -jar cljs.jar -m cljs.repl.node
ClojureScript Node.js REPL server listening on 56211
To quit, type: :cljs/quit
cljs.user=> (ffirst 1)
repl:13
throw e__5614__auto__;
^

Error: 1 is not ISeqable
    at Object.cljs$core$seq [as seq] (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:4097:8)
    at Object.cljs$core$first [as first] (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:4116:19)
    at cljs$core$ffirst (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:5512:34)
    at repl:1:96
    at repl:9:3
    at repl:14:4
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at Object.runInThisContext (vm.js:116:38)
    at Domain.<anonymous> ([stdin]:50:34)
    at Domain.run (domain.js:242:14)
cljs.user=>

git bisect shows it is caused by CLJS-1893:

462e2295d6e6c1a01b279c8aa091f832c9d09824 is the first bad commit
commit 462e2295d6e6c1a01b279c8aa091f832c9d09824
Author: dnolen <dnolen@cognitect.com>
Date:   Fri Jan 20 15:21:12 2017 -0500

    CLJS-1893: Unnecessary analysis of core.cljs

    In all places where opts is optionally provided check to see if cljs.env/*compiler* is bound, if it is deref and read :options

:040000 040000 eb9ed33f31e1c8b322c18212752573ce449c17aa 955f16b82539e257d22ab135b4ae048cceb47b73 M	src





[CLJS-2273] Bump tools.reader to 1.0.3 and development dependencies Created: 25/Jul/17  Updated: 26/Jul/17  Resolved: 26/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: Next

Type: Task Priority: Critical
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-2273.patch    
Approval: Accepted

 Comments   
Comment by David Nolen [ 26/Jul/17 4:20 AM ]

fixed https://github.com/clojure/clojurescript/commit/6c2d17e3e3bfc725c52f6cadb7a808693f07c8d1





[CLJS-2269] Warn on top level code split loads Created: 24/Jul/17  Updated: 26/Jul/17  Resolved: 26/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: Next
Fix Version/s: Next

Type: Enhancement Priority: Critical
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: modules

Approval: Vetted

 Description   

See CLJS-2264 & and CLJS-2265. We should warn on top-level module loading and provide some basic guidance. Docs should make expectations clear.



 Comments   
Comment by David Nolen [ 26/Jul/17 4:07 AM ]

fixed https://github.com/clojure/clojurescript/commit/364c2ff66bf7e7ff11a28d9366f3f98a82ffdbcb





[CLJS-2272] Tests that depended on default install deps behavior failing Created: 25/Jul/17  Updated: 25/Jul/17  Resolved: 25/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: Next

Type: Defect Priority: Blocker
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: js-modules, test

Attachments: Text File CLJS-2272.patch    
Patch: Code and Test

 Comments   
Comment by David Nolen [ 25/Jul/17 3:18 PM ]

fixed https://github.com/clojure/clojurescript/commit/ea923717762ac4c7ba7d38e4ecbc5e4b36ce73c1





[CLJS-1854] Self-host: Reload ns with const Created: 16/Nov/16  Updated: 25/Jul/17

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Critical
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: bootstrap


 Description   

Bootstrapped ClojureScript fails to allow you to reload a namespace containing a constant.

To reproduce, evaluate the following forms in a REPL:

(require 'cljs.js)

(def st (cljs.js/empty-state))

(cljs.js/eval st
  '(require (quote foo.core))
  {:context :expr
   :eval cljs.js/js-eval
   :load (fn [_ cb]
           (cb {:lang :clj
                :source "(ns foo.core) (def ^:const x 1)"}))}
  prn)

(cljs.js/eval st
  '(require (quote foo.core) :reload)
  {:context :expr
   :eval cljs.js/js-eval
   :load (fn [_ cb]
           (cb {:lang :clj
                :source "(ns foo.core) (def ^:const x 2)"}))}
  prn)

The expectation is that the :reload directive in the last require will allow the namespace to be loaded with the const def being re-defined.

Instead, you get the following in the eval callback:

{:error #error {:message "Could not eval foo.core", :data {:tag :cljs/analysis-error}, :cause #error {:message "Can't redefine a constant at line 1 ", :data {:file nil, :line 1, :column 15, :tag :cljs/analysis-error}}}}

Note: This has probably been a defect in bootstrapped ClojureScript for quite a while (maybe forever). In particular, it is not a regression introduced with the new require capability (CLJS-1346).

FWIW, Planck has been working around this (and violating public API), manipulating cljs.js/*loaded* via its require REPL special, essentially purging portions of the analysis cache when reloading: https://github.com/mfikes/planck/blob/1.17/planck-cljs/src/planck/repl.cljs#L329-L348



 Comments   
Comment by David Nolen [ 08/Jul/17 10:50 AM ]

I'm now inclined to say that throwing an error on this is misfeature. We should just warn.





[CLJS-2058] Update known compiler options Created: 29/May/17  Updated: 25/Jul/17  Resolved: 25/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Shaun LeBron Assignee: Shaun LeBron
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-2058.patch    

 Description   

Add the following known options:

  • closure-module-roots
  • rewrite-polyfills
  • use-only-custom-externs
  • watch-error-fn
  • watch-fn (moved from known-repl-opts, since this is not repl-specific)


 Comments   
Comment by David Nolen [ 16/Jun/17 9:11 AM ]

Please don't reformat code when making small changes like this. Thanks.

Will apply an updated patch that doesn't change formatting.

Comment by David Nolen [ 25/Jul/17 1:34 AM ]

fixed https://github.com/clojure/clojurescript/commit/fb8ce05143dac9e9feb602be2544b72c87b337a3





[CLJS-2255] Clean up :npm-deps Created: 17/Jul/17  Updated: 25/Jul/17  Resolved: 25/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: Next
Fix Version/s: Next

Type: Task Priority: Critical
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: npm-deps

Attachments: Text File CLJS-2255.patch    

 Description   

We should separate module installation from building and REPLs. I propose the following new public build fns:

cljs.build.api/install-deps!
cljs.build.api/get-deps
cljs.build.api/print-deps


 Comments   
Comment by David Nolen [ 17/Jul/17 2:00 AM ]

`get-deps` should return a vector of {:name ... :version ... :type ...} entries

Comment by António Nuno Monteiro [ 17/Jul/17 8:37 PM ]

Attached a tentative patch adding `cljs.build.api/install-node-deps!` and `cljs.build.api/get-node-deps` functions.

Looking for feedback if this is the satisfies the requirements for what you had in mind. IMO printing dependencies is just a call away from `get-node-deps`.

Comment by David Nolen [ 18/Jul/17 12:36 AM ]

I agree about printing deps. These functions should probably take compiler options since they are user facing and that's the easiest interface from that standpoint.

We should also remove automatic calls to dep installation in build as well as REPLs. Installing dependencies on each build, REPL start just doesn't seem like a good idea.

Comment by David Nolen [ 25/Jul/17 1:19 AM ]

After thinking about it some more I think the supplied patch is OK.

Comment by David Nolen [ 25/Jul/17 1:26 AM ]

fixed https://github.com/clojure/clojurescript/commit/8972224b4b4617a98a9fdd497af1aeb91a29ed2a





[CLJS-2235] Allow passing extra maven opts to build scripts Created: 14/Jul/17  Updated: 25/Jul/17  Resolved: 25/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: Next
Fix Version/s: Next

Type: Enhancement Priority: Critical
Reporter: Antonin Hildebrand Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: test-matrix

Attachments: Text File CLJS-2235.patch    
Patch: Code
Approval: Vetted

 Description   

I canary project[1] I need to run all maven commands in --batch-mode to prevent download progress messages output and also optionally I want to run it with --quiet flag to optionally suppress its verbose output.

This patch introduces CLJS_SCRIPT_MVN_OPTS env var which can be optionally specified to provide extra command line opts to all mvn commands executed within build scripts.

[1] https://github.com/cljs-oss/canary
[2] https://github.com/cljs-oss/canary/blob/9772649eae7097156251f4abb7ee70ea349ea99b/runner/scripts/build_compiler.sh#L74



 Comments   
Comment by David Nolen [ 25/Jul/17 1:25 AM ]

fixed https://github.com/clojure/clojurescript/commit/c6f879f0ec25ed465cee4c3d2df7850940dee777





[CLJS-2261] Issue using interop record constructors in macros namespaces Created: 18/Jul/17  Updated: 24/Jul/17

Status: In Progress
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.671
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File CLJS-2261-test.patch    

 Description   

Repro:

(require 'cljs.js)

(let [st (cljs.js/empty-state)]
  (cljs.js/eval-str st "(ns cljs.user (:require [foo.bar :refer-macros [cake]]))" nil
    {:eval cljs.js/js-eval
     :load (fn [{:keys [macros]} cb]
             (if macros
               (cb {:lang   :clj
                    :source "(ns foo.bar) (defmacro cake [] `(X.))"})
               (cb {:lang   :clj
                    :source "(ns foo.bar) (defrecord X [])"})))}
    (fn [_]
      (cljs.js/eval-str st "(cake)" nil
        {:eval cljs.js/js-eval
         :context :expr} prn))))

Expected:

{:ns cljs.user, :value #foo.bar.X{}}

Master produces:

WARNING: Use of undeclared Var cljs.user/X at line 1
WARNING: Use of undeclared Var cljs.user/X at line 1
{:error #error {:message "ERROR", :data {:tag :cljs/analysis-error}, :cause #object[TypeError TypeError: cljs.user.X is not a constructor]}}

Not a regression as far as I can tell, and also affects regular JVM ClojureScript.



 Comments   
Comment by David Nolen [ 24/Jul/17 12:24 AM ]

I believe I know the problem. `dotted-symbol?` needs to ignore `foo.` cases (we just do a naive goog.string/contains check). Can you provide a test patch and I can apply that and then try the fix? Thanks.

Comment by Mike Fikes [ 24/Jul/17 12:41 PM ]

Hey David, the test in this ticket is somewhat incorrect in that it has a macro expanding to a defrecord defined in the macro namespace instead of in the ClojureScript namespace. Fixing that aspect in the description.

Fixing this aspect of the ticket shows that this is not a regression, as far as I can tell.

It also affects JVM ClojureScript.

Things work if the macro uses (->X) instead of (X.), so the defect is constrained to using constructor interop.

Your hunch may still be correct because it still fails in the same way.

Attaching a patch that adds tests specifically for self-host (script/test-self-host})), as well as general tests that will run on JVM and self-host ({{script/teest and script/test-self-parity).





[CLJS-2271] native-satisfies? using aget Created: 24/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Mike Fikes
Resolution: Not Reproducible Votes: 0
Labels: None


 Description   

native-satisfies? is using aget and should instead be using either gobj/get or unchecked-get.



 Comments   
Comment by Mike Fikes [ 24/Jul/17 9:33 AM ]

Already fixed with https://github.com/clojure/clojurescript/commit/84a2128dab9f52e67ee227a66be4f849d83de0a3





[CLJS-2270] Support AOT compilation of macro namespaces (bootstrap) Created: 24/Jul/17  Updated: 24/Jul/17

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.671
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: bootstrap

Approval: Vetted




[CLJS-2267] Allow ^:const inlined vars to affect if emission Created: 21/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.655
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: core

Attachments: Text File CLJS-2267.patch    
Patch: Code and Test
Approval: Accepted

 Description   

If an if test is a truthy or falsey constant, this fact is used to emit either the then or else branch, while also avoiding Closure warnings about unreachable code.

With the new ^:const Var inlining feature, we can allow a modest broadening of scope to also allow for truthy or falsey const expressions, perhaps slightly improving performance of affected code that is not run through Closure, and also avoiding new unreachable code warnings that can otherwise now crop up with the new JavaScript that results from ^:const Var inlining.



 Comments   
Comment by David Nolen [ 24/Jul/17 12:59 AM ]

fixed https://github.com/clojure/clojurescript/commit/e6ad026c5fca50fc572e2f7a858b546a02cc28aa





[CLJS-2265] Library namespaces loading before their dependencies with :none optiizations Created: 20/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: Next
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Peter Schuck Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: bug, repl


 Description   

Loading ClojureScript module that has library dependencies will fail due to the library namespaces loading before their dependencies.

For example say the have a project with a cljs-time ([com.andrewmcveigh/cljs-time "0.5.0"]) dependency, there modules

:modules {:core {:entries '#{org.modules.transitive}
                 :output-to "out/modules.js"}
          :time {:entries '#{org.modules.time}
                 :output-to "out/time.js"}}

and this code

(ns org.modules.time
  (:require [cljs-time.core :as ct]
            [cljs.loader :as loader]))

(defn display-time [time]
  time)
(ns org.modules.transitive
  (:require [cljs.loader :as loader]))

(loader/load
  :time
  (fn []
    (js/console.log ((resolve 'org.modules.time/display-time) 100))))

When the :time module is loaded the cljs-time.core is loaded, but any dependencies it may have (e.g. cljs-time.core.internal) are loaded afterwards causing the loading of the :time module to fail. After a backoff delay (around 5 seconds) the Google Closure Module Manager retries loading the :time module, this time successfully. Until the :time module is loaded successfully all module loading is subject to this backoff delay.

Demonstration Repo



 Comments   
Comment by David Nolen [ 24/Jul/17 12:33 AM ]

CLJS-2264





[CLJS-2264] Double loading of :cljs-base with :none optimizations Created: 20/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: Next
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Peter Schuck Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: bug, repl


 Description   

If a project has these modules

:modules {:core {:entries '#{org.modules.core}
                 :output-to "out/modules.js"}
          :menu {:entries '#{org.modules.menu}
                 :output-to "out/menu.js"}}

and this root (org.modules.core) namespace

(ns org.modules.core
  (:require [cljs.loader :as loader]))

(loader/load
  :menu
  (fn [] (js/console.log "Module loaded)))

Then the :cljs-base module will be loaded twice.

The issue is that the loading of :menu causes `:cljs-base` to be loaded as well. Loading the root namespace marks :cljs-base as loaded but only at the end of the file. Under the hood ClojureScript adds

(cljs.loader/set-loaded! :core)

at the end of the :core module. By then it's too late, the :menu module has already started loading.

This is only a problem in the REPL due to the :cljs-base module being loaded through document.write.

Demonstration Repo



 Comments   
Comment by David Nolen [ 24/Jul/17 12:30 AM ]

This is not a bug. Loading modules like this at the top-level means you need to call set-loaded! yourself. In general what is being shown here is an antipattern. If you're just going to immediately load some other module why are you using code splitting?

One simple workaround is to simply put a setTimeout around this top level load.





[CLJS-2263] Docstring for neg-int? backwards Created: 19/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.293
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: docstring

Attachments: Text File CLJS-2263.patch    
Patch: Code

 Description   

Typo introduced here for neg-int?'s docstring:

https://github.com/clojure/clojurescript/commit/224e140117d330933fb9b7e993ff26f997f36cbd



 Comments   
Comment by David Nolen [ 24/Jul/17 12:27 AM ]

fixed https://github.com/clojure/clojurescript/commit/39b6c260837d2eec33b60a30f805b62146364383





[CLJS-2262] Correct comment that *warn-on-infer* is file-scope Created: 19/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: Next
Fix Version/s: None

Type: Defect Priority: Trivial
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: documentation

Attachments: Text File CLJS-2262.patch    
Patch: Code

 Description   

I had accidentally written a comment in the code next to *warn-on-infer* indicating that it has global scope.



 Comments   
Comment by David Nolen [ 24/Jul/17 12:26 AM ]

fixed https://github.com/clojure/clojurescript/commit/3037f04cdc7d8cc977842e9f129ef9f3aee70796





[CLJS-2258] Stack overflow regression for sequence xform applied to eduction Created: 18/Jul/17  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.562
Fix Version/s: None

Type: Defect Priority: Critical
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: regression, transducers

Attachments: Text File CLJS-2258.patch    
Patch: Code and Test
Approval: Accepted

 Description   

There is a regression in the ability to use sequence to apply transducers to eductions that was introduced with 1.9.562.

In 1.9.542 and earlier,

(sequence (map str) (eduction [1]))
produced ("1").

Minimal repro:

$ java -jar cljs.jar -m cljs.repl.node
ClojureScript Node.js REPL server listening on 50609
To quit, type: :cljs/quit
cljs.user=> (sequence (map str) (eduction [1]))
repl:13
throw e__5525__auto__;
^

RangeError: Maximum call stack size exceeded
    at Function.cljs.core.TransformerIterator.create (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:13959:50)
    at cljs.core.Eduction.cljs$core$IIterable$_iterator$arity$1 (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:33244:38)
    at Object.cljs$core$_iterator [as _iterator] (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:3158:13)
    at Object.cljs$core$iter [as iter] (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:13554:18)
    at Function.cljs.core.TransformerIterator.create (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:13960:55)
    at cljs.core.Eduction.cljs$core$IIterable$_iterator$arity$1 (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:33244:38)
    at Object.cljs$core$_iterator [as _iterator] (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:3158:13)
    at Object.cljs$core$iter [as iter] (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:13554:18)
    at Function.cljs.core.TransformerIterator.create (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:13960:55)
    at cljs.core.Eduction.cljs$core$IIterable$_iterator$arity$1 (/Users/mfikes/Downloads/.cljs_node_repl/.cljs_node_repl/cljs/core.js:33244:38)


 Comments   
Comment by Mike Fikes [ 18/Jul/17 7:36 AM ]

CLJS-2034:

d93c4356e7ab78743ae66d8cffe8df54869f0be3 is the first bad commit
commit d93c4356e7ab78743ae66d8cffe8df54869f0be3
Author: António Nuno Monteiro <anmonteiro@gmail.com>
Date:   Fri May 12 13:39:37 2017 -0700

    CLJS-2034: Sequence and Eduction produce infinite loop in transducer that appends to the reduction

    The implementation of transducers in ClojureScript tracked an old counterpart in
    the Clojure codebase. This patch addresses the change introduced in the
    following commit to Clojure, which replaced `LazyTransformer` with
    `TransformerIterator`, effectively making the transducer behavior akin to the
    one in Clojure.

    https://github.com/clojure/clojure/commit/c47e1bbcfa227723df28d1c9e0a6df2bcb0fecc1

:040000 040000 001a34e8f941a2e1697299be2632143e3e191587 5a508a3162eb9eb1023c0c0cd9ff7ee9cf2ad733 M	src
Comment by António Nuno Monteiro [ 18/Jul/17 12:08 PM ]

Attached patch with fix and test.

Comment by Mike Fikes [ 18/Jul/17 12:37 PM ]

I don't know if this is a bug or not, but with 1.9.542

cljs.user=> (iter (eduction [1 2 3]))
#object[cljs.core.SeqIter]

and after the patch:

cljs.user=> (iter (eduction [1 2 3]))
repl:13
throw e__8096__auto__;
^

Error: [object Object] is not ISeqable
    at Object.cljs$core$seq [as seq] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:4413:8)
    at Object.cljs$core$pr_sequential_writer [as pr_sequential_writer] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31431:14)
    at cljs.core.TransformerIterator.cljs$core$IPrintWithWriter$_pr_writer$arity$3 (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:32456:18)
    at Object.cljs$core$pr_writer_impl [as pr_writer_impl] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31612:12)
    at Object.cljs$core$pr_writer [as pr_writer] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31722:18)
    at Object.cljs$core$pr_seq_writer [as pr_seq_writer] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31726:11)
    at Object.cljs$core$pr_sb_with_opts [as pr_sb_with_opts] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31789:11)
    at Object.cljs$core$pr_str_with_opts [as pr_str_with_opts] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31803:63)
    at Function.cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31886:18)
    at Object.cljs$core$pr_str [as pr_str] (/Users/mfikes/Projects/clojurescript/.cljs_node_repl/.cljs_node_repl/cljs/core.js:31882:25){

I wonder if there is some public code path where this would show up (as opposed to directly calling iter).

Comment by António Nuno Monteiro [ 18/Jul/17 12:57 PM ]

`(iter (eduction [1 2 3]))` is now a TransformerIterator, which doesn't have a print method.

For comparison with Clojure:

user=> (clojure.lang.RT/iter (eduction [1 2 3]))
#object[clojure.lang.TransformerIterator 0x28adf451 "clojure.lang.TransformerIterator@28adf451"]
Comment by David Nolen [ 24/Jul/17 12:12 AM ]

fixed https://github.com/clojure/clojurescript/commit/f6f4c0431b21fcc87b4de0fcb41f799083f98b9b





[CLJS-2268] clojure.string/escape in ClojureScript (unlike in Clojure) assumes cmap is a map Created: 23/Jul/17  Updated: 23/Jul/17

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.671
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Max Kreminski Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: cljs


 Description   

The ClojureScript implementation of the clojure.string/escape function assumes that the cmap parameter will always be a map. This makes it different from (and specifically less general than) the Clojure implementation of the same function, which permits cmap to be anything callable.

Here's the relevant lines of the clojure.string/escape implementations in Clojure and ClojureScript. The ClojureScript implementation calls get on cmap, while the Clojure implementation invokes cmap directly.

Here's an example that works on Clojure, but doesn't work on ClojureScript, because it passes a function to clojure.string/escape instead of a map:

(defn regex-escape
  "Escapes regex special chars in the string `s`."
  [s]
  (let [special? #{\- \[ \] \{ \} \( \) \* \+ \? \. \\ \^ \$ \|}]
    (clojure.string/escape s #(when (special? %) (str \\ %)))))

Ideally, this discrepancy would be fixed by changing the ClojureScript implementation of clojure.string/escape to follow the Clojure one. This would also match the behavior described in the function's docstring, which is the same on both platforms.






[CLJS-2266] Self-host: Cannot require clojure.x where clojure.x has no macros namespace Created: 21/Jul/17  Updated: 21/Jul/17

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 1.9.655, 1.9.660, 1.9.671
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Viktor Magyari Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: bootstrap


 Description   

Repro:

(require 'cljs.js)

(cljs.js/eval-str (cljs.js/empty-state)
                  "(require 'clojure.x)"
                  nil
                  {:eval cljs.js/js-eval
                   :load (fn [{:keys [name macros]} cb]
                           (cb (when (and (= name 'cljs.x)
                                          (not macros))
                                 {:lang   :clj
                                  :source "(ns cljs.x)"})))}
                  println)

Expected result:

{:ns cljs.user, :value nil}

Actual result:

{:error #error {:message No such macros namespace: cljs.x, could not locate cljs/x.clj or cljs/x.cljc, :data {:tag :cljs/analysis-error}}}

Git bisect indicates CLJS-2069:

d4db18970c8eec587b2c9e022034983e29eb8e81 is the first bad commit
commit d4db18970c8eec587b2c9e022034983e29eb8e81
Author: António Nuno Monteiro <anmonteiro@gmail.com>
Date:   Sat Jun 3 15:10:40 2017 -0700

    CLJS-2069: Self-host: automatic `clojure` -> `cljs` aliasing doesn't work when loading macro namespaces

:040000 040000 31b0ec3b5346c8959e48487449576114b9d9a2ea 59d730263393923274257ea1eadaf4c2828c4199 M      src


 Comments   
Comment by Mike Fikes [ 21/Jul/17 1:20 PM ]

A concrete example of this is the inability to require cljs.tools.reader by indicating clojure.tools.reader.





[CLJS-2069] Self-host: auto `clojure`->`cljs` aliasing doesn't work when loading macros Created: 03/Jun/17  Updated: 21/Jul/17  Resolved: 04/Jun/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: 1.9.655

Type: Defect Priority: Minor
Reporter: António Nuno Monteiro Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: bootstrap

Attachments: Text File CLJS-2069.patch    
Patch: Code and Test

 Comments   
Comment by António Nuno Monteiro [ 03/Jun/17 5:16 PM ]

Attached patch with fix & test.

Comment by Mike Fikes [ 03/Jun/17 5:47 PM ]

I can confirm downstream Planck passes all of its tests with the patch and this works:

cljs.user=> (require-macros 'clojure.spec.alpha)
nil

while without the patch the issue is exhibited:

cljs.user=> (require-macros 'clojure.spec.alpha)
No such macros namespace: clojure.spec.alpha, could not locate clojure/spec/alpha.clj or clojure/spec/alpha.cljc
Comment by David Nolen [ 04/Jun/17 6:59 AM ]

fixed https://github.com/clojure/clojurescript/commit/d4db18970c8eec587b2c9e022034983e29eb8e81

Comment by Mike Fikes [ 21/Jul/17 1:14 PM ]

See regression CLJS-2266





[CLJS-1461] Convert analyzer to conform to tools.analyzer's spec Created: 28/Sep/15  Updated: 19/Jul/17

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 1.7.145
Fix Version/s: 1.9.671

Type: Enhancement Priority: Major
Reporter: Ambrose Bonnaire-Sergeant Assignee: Ambrose Bonnaire-Sergeant
Resolution: Unresolved Votes: 6
Labels: None


 Description   

tools.analyzer has a handy common AST format for map-based analysis results. We should use this format in the ClojureScript analyzer so tooling that already accepts this format can work seamlessly with ClojureScript.

Work in progress: https://github.com/frenchy64/clojurescript/pull/7

Order of work:

  1. Patch 1 ready for review
    • :const
      • rename :constant op to :const
      • add :val entry
  2. :def
    • rename :var-ast entry to :var I misunderstood :var-ast, :var entry is already there and perfectly fine.
    • add :ns entry
  3. :the-var
    • rename :var-special op to :the-var
  4. :throw
    • rename :throw entry to :exception
  5. :try
    • rename :try entry to :body
  6. :letfn
    • rename :expr entry to :body
  7. :let/:loop
    • rename :expr entry to :body
  8. :quote
    • add :quote op
  9. :deftype
    • rename :deftype* op to :deftype
  10. :defrecord
    • rename :defrecord* op to :defrecord
  11. :host-field/:host-method
    • split :dot op into :host-field/:host-method
  12. :invoke
    • rename :f to :fn
  13. :js-object/:js-array
    • split :js-value op into :js-object/:js-array
  14. :with-meta
    • rename :meta op to :with-meta
  15. :var/:binding/:local/:js-var
    • split :var op into :var/:binding/:local/:js-var
    • emit :local op if :js-shadowed-by-local
    • change :local to be #{:fn :letfn :let :arg ...}
  16. :fn-method
    • add :fn-method op to :methods of a :fn
    • :variadic -> :variadic?
    • :expr -> :body
    • add :fixed-arity
  17. :children
    • move to tools.analyzer :children format + replace :children calls with a compatible function from AST -> children
  18. Unit tests
    • add them all at the end
  19. AST format documentation
    • modify from tools.analyzer's

Extra stuff:

  • argument validation in 'var parsing
  • :max-fixed-arity -> :fixed-arity
  • :case node overhaul
    • which format do we follow?
    • TAJ vs TAJS





Generated at Wed Jul 26 07:52:49 CDT 2017 using JIRA 4.4#649-r158309.