<< Back to previous view

[CLJS-1766] Set literals in REPL end up reified as ArrayMap backed PersistentHashSets. Created: 28/Aug/16  Updated: 28/Aug/16

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

Type: Defect Priority: Minor
Reporter: Thomas Mulvaney Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: repl


 Description   

Entering a set literal in the REPL with more than 8 elements should create a PHM backed set but instead it is array backed.

Example (in REPL):
cljs.user=> (type (.-hash-map #{1 2 3 4 5 6 7 8 9}))
cljs.core/PersistentArrayMap

This means operations such as `get` and `contains?` end up doing long scans and are slower than a user would expect.






[CLJS-1765] Empty iterator for some hash maps with a nil key Created: 27/Aug/16  Updated: 28/Aug/16

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

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

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

 Description   

Two specific examples:

cljs.user=> (.hasNext (-iterator {:a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8 nil 9}))
false
cljs.user=> (.hasNext (-iterator (hash-map nil 1))))
false

This can affect "user-level" code as follows:

cljs.user=> (sequence (map identity) {:a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8 nil 9})
()
cljs.user=> (sequence (map identity) (hash-map nil 1))
()


 Comments   
Comment by Thomas Mulvaney [ 27/Aug/16 5:27 PM ]

I've attached a simple patch with some tests.

Comment by Mike Fikes [ 27/Aug/16 6:22 PM ]

Confirmed CA at http://clojure.org/community/contributors

Comment by Mike Fikes [ 27/Aug/16 6:35 PM ]

The first ^boolean in the form (or ^boolean (not seen) ^boolean (.hasNext root-tier)) could be omitted.

The patch passes unit tests for me (both JVM and self-host) and causes the correct output to appear for the examples

Comment by Thomas Mulvaney [ 28/Aug/16 4:05 AM ]

Thanks Mike Fikes, I omitted that boolean flag per your suggestion. Updated patch now attached.





[CLJS-1764] Double warning for undeclared Var Created: 26/Aug/16  Updated: 26/Aug/16

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

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

A regression occurred where an undeclared Var in a {{require}}d file causes two diagnostics:

$ more src/foo/core.cljs
(ns foo.core)

(def x 2)

abc
$ rm -rf .cljs_node_repl
$ java -cp cljs-1.9.227.jar:src clojure.main -m cljs.repl.node
ClojureScript Node.js REPL server listening on 52749
To quit, type: :cljs/quit
cljs.user=> *clojurescript-version*
"1.9.227"
cljs.user=> (require 'foo.core)
WARNING: Use of undeclared Var foo.core/abc at line 5 /Users/mfikes/Desktop/src/foo/core.cljs
WARNING: Use of undeclared Var foo.core/abc at line 5 /Users/mfikes/Desktop/src/foo/core.cljs
nil
cljs.user=> :cljs/quit
$ rm -rf .cljs_node_repl
$ java -cp cljs-1.9.211.jar:src clojure.main -m cljs.repl.node
ClojureScript Node.js REPL server listening on 56704
To quit, type: :cljs/quit
cljs.user=>  *clojurescript-version*
"1.9.211"
cljs.user=> (require 'foo.core)
WARNING: Use of undeclared Var foo.core/abc at line 5 /Users/mfikes/Desktop/src/foo/core.cljs
nil
cljs.user=> :cljs/quit





[CLJS-1763] Defining a var that clashes with `cljs.core` throws a compiler error instead of warning Created: 24/Aug/16  Updated: 24/Aug/16  Resolved: 24/Aug/16

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

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

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

 Comments   
Comment by António Nuno Monteiro [ 24/Aug/16 10:43 AM ]

Attached patch with fix and test.

Comment by David Nolen [ 24/Aug/16 11:40 AM ]

fixed https://github.com/clojure/clojurescript/commit/7a06d008fadf56b11dba0f9e2ab97e61059f44fc





Generated at Tue Aug 30 02:28:17 CDT 2016 using JIRA 4.4#649-r158309.