<< Back to previous view

[CLJS-1964] Validate that `:target :nodejs` and no optimizations requires a `:main` option to be present Created: 01/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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

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

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

 Comments   
Comment by David Nolen [ 17/Mar/17 2:44 PM ]

fixed https://github.com/clojure/clojurescript/commit/197ff2e7c3f96b365e31cf4c1a4af39bdd60fc88





[CLJS-1956] Add missing JS reserved keywords Created: 27/Feb/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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

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

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

 Comments   
Comment by David Nolen [ 17/Mar/17 2:33 PM ]

fixed https://github.com/clojure/clojurescript/commit/2171ae9859a2e982497764a04de10916aae68307





[CLJS-1983] res -> mres in spec.cljs Created: 17/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

Status: Resolved
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-1983.patch    
Patch: Code

 Comments   
Comment by David Nolen [ 17/Mar/17 2:26 PM ]

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





[CLJS-1976] hash-map assoc stackoverflow Created: 13/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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

Type: Defect Priority: Major
Reporter: Francis Avila Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None
Environment:

Using clojurescript master and a browser environment


Attachments: Text File CLJS-1976.patch    

 Description   

A particular combination of keys in a hash-map will cause a stackoverflow when added into the same hash-map, whether using transient or non-transient assoc.

Minimal case:

(defrecord T [index a b])

(def bad-key-1 (map->T {:index :eavt, :a 17592186192276, :b nil}))
(def bad-key-2 (map->T {:index :avet, :a 10, :b :fhir.ElementDefinition/minValueDateTime$cr}))

;; Implicit Transient assoc
(hash-map bad-key-1 nil bad-key-2 nil)

;RangeError: Maximum call stack size exceeded

;;; From a browser console:
;core.cljs:5034 Uncaught RangeError: Maximum call stack size exceeded
;cljs.core.PersistentVector.cljs$core$ISeqable$_seq$arity$1 @ core.cljs:5034
;cljs$core$seq @ core.cljs:1121
;cljs.core.concat.cljs$core$IFn$_invoke$arity$2 @ core.cljs:3619
;cljs.core.LazySeq.sval @ core.cljs:3269
;cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 @ core.cljs:3323
;cljs$core$seq @ core.cljs:1121
;cljs.core.pr_str.call.cljs.user.T.cljs$core$ISeqable$_seq$arity$1 @ VM2295:158
;cljs$core$seq @ core.cljs:1121
;cljs$core$first @ core.cljs:1143
;(anonymous) @ core.cljs:4049
;cljs$core$every_QMARK_ @ core.cljs:4049
;cljs$core$equiv_map @ core.cljs:5836
;(anonymous) @ VM2295:114
;cljs.core.pr_str.call.cljs.user.T.cljs$core$IEquiv$_equiv$arity$2 @ VM2295:118
;cljs$core$_equiv @ core.cljs:617
;cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2 @ core.cljs:1179
;cljs$core$key_test @ core.cljs:6494
;cljs.core.BitmapIndexedNode.inode_assoc_BANG_ @ core.cljs:6752
;cljs.core.create_node.cljs$core$IFn$_invoke$arity$7 @ core.cljs:7050
;(anonymous) @ core.cljs:6760
;;; Last 3 lines repeat forever


;; Explicit non-transient assoc
(assoc (hash-map bad-key-1 nil) bad-key-2 nil)

;RangeError: Maximum call stack size exceeded
;;; Stack is similar to above, except `inode-assoc` instead of `inode-assoc!`
;;; is repeating, because this version is not transient

As near as I can tell, the fundamental problem is that the (zero? (bit-and bitmap bit)) test in inode-assoc is always false. I have a hunch this is due to some bit-twiddling difference between js and Java that isn't accounted for in bit-count or bitmap-indexed-node-index or the recursive call to inode-assoc. I am investigating further.



 Comments   
Comment by Francis Avila [ 13/Mar/17 6:13 PM ]

(Just to note: we encountered this issue in production.)

The fundamental problem is that JS hash values may use more than 32 bits, but only 32 bits should be considered.

These two records have different hash values, but if only 32 bits are compared they have the same hash value. At least create-node naively assumes that hash values are normalized and does normal comparison between them using ==, meaning it does not detect the hash collision correctly.

This is a problem for records because they use an older (pre-murmur) hash-imap, which is not careful to truncate to 32 bits.

However, it is also a problem for dates for the same reason:

(hash-map #inst "2017-03-13T22:21:08.666-00:00" nil  #inst "2015-11-02T19:53:15.706-00:00" nil)
;RangeError: Maximum call stack size exceeded

My proposed fix is to force all hash values to be normalized to 32 bits to preserve the invariant that two equal hash values means they collide.

Comment by David Nolen [ 17/Mar/17 2:24 PM ]

fixed https://github.com/clojure/clojurescript/commit/3449c5328356fb4951d1a950158b88e339818d0b





[CLJS-1973] Add support for `:npm-deps` in upstream `deps.cljs` Created: 11/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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

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

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

 Comments   
Comment by Thomas Heller [ 12/Mar/17 4:19 AM ]

Wrote about this in Slack but I wanted to properly voice my concerns so they don't get lost in Slack archives.

I think managing npm via CLJS is a bad idea. While this is very interesting it could/should probably happen in a library. We will inherit all the woes npm brings and force this onto the user. What if the user prefers yarn? What if the user is using a tool with support for package.json but not deps.cljs?

I voiced similar concerns a while ago [1] and with everything happening recently with regards to JS modules the situation is getting worse. It may appear that this work must happen in CLJS but really could happen somewhere else without making cljs.core more complicated. clojure.core doesn't bundle with leiningen for good reason.

IMHO, YMMV

[1] https://groups.google.com/d/msg/clojurescript/xMQuEmQt7oQ/AWT5RZe_nQQJ

Comment by David Nolen [ 17/Mar/17 2:23 PM ]

fixed https://github.com/clojure/clojurescript/commit/21da03e03e229a0b38fb872485d26a30fbf034b8





[CLJS-1978] Port CLJ-2035 Created: 14/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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

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

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

 Description   

CLJ-2035 has made it into Clojure 1.9.0-alpha15



 Comments   
Comment by António Nuno Monteiro [ 14/Mar/17 12:40 PM ]

Attached patch with fix and tests.

Comment by David Nolen [ 17/Mar/17 1:54 PM ]

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





[CLJS-1979] Port CLJ-2043 (fix s/form of s/conformer) Created: 14/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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: spec

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

 Description   

this is in clojure 1.9.0-alpha15



 Comments   
Comment by David Nolen [ 17/Mar/17 1:50 PM ]

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





[CLJS-1980] port CLJ-2100 (s/nilable form should retain original spec form) Created: 14/Mar/17  Updated: 17/Mar/17  Resolved: 17/Mar/17

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

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

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

 Comments   
Comment by David Nolen [ 17/Mar/17 1:47 PM ]

fixed https://github.com/clojure/clojurescript/commit/1c9802043de28b8c331bc7e3c27b651450147731





Generated at Wed Mar 22 23:23:13 CDT 2017 using JIRA 4.4#649-r158309.