<< Back to previous view

[CLJS-523] IHash not extended to js/Date Created: 17/Jun/13  Updated: 19/Mar/14  Resolved: 19/Mar/14

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

Type: Defect Priority: Minor
Reporter: Chas Emerick Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


Makes for fun times, like:

cljs.user=> ((hash-map #inst "1990-01-29T00:39:33.938-00:00" 5) #inst "1990-01-29T00:39:33.938-00:00")

Happy to put together a patch implementing a sane IHash impl for js/Date. Have not done so already only because js/Date does have a place in core.cljs where core protocols are being extended to host types, but IHash just isn't included; perhaps there was a reason?

Comment by David Nolen [ 17/Jun/13 11:10 AM ]

This implies modifying the prototype of a native in core, I'm not very excited about that. I'm inclined to say that users should deal with js/Date themselves.

Comment by Fogus [ 17/Jun/13 12:52 PM ]

> users should deal with js/Date themselves


Comment by Chas Emerick [ 17/Jun/13 1:41 PM ]

Didn't that ship sail already with IEquiv?

Comment by David Nolen [ 17/Jun/13 1:47 PM ]

No and we will probably remove that. Our modification of the String prototype has already wrecked havoc as far as interop goes. There is simply no justification for modifying natives in core.

Comment by David Nolen [ 17/Jun/13 2:00 PM ]

Actually we should just add Date to the list of natives that are specially handled along with object, boolean, string etc.

Comment by Chas Emerick [ 17/Jun/13 2:00 PM ]

Opened CLJS-525 per dnolen's suggestion in irc, to allow things like this to be supported without touching built-in prototypes.

Comment by Chas Emerick [ 19/Mar/14 9:32 AM ]

wontfix, closing. CLJS-525

Generated at Tue Jan 23 10:28:47 CST 2018 using JIRA 4.4#649-r158309.