ClojureScript

Lookup for Date keys does not work in PersistentMaps and PersistentSets

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Clojurescript version "0.0-2080"
    Browser : Firefox 25.0.1
                  : Chrome 31.0.1650.63

Description

Lookup of js/Date objects fails, if there are more than 8 elements in the map. Works correctly if the map contains 8 elements or less.

Examples :

1. Map with more than 8 elements

cljs.user> (def test-map
{
:a 1
:b 2
#inst "2013-12-19T05:00:00.000-00:00" 3
:d 4
:e 5
#inst "2013-12-06T05:00:00.000-00:00" 6
:g 7
:h 8
:i 9
:j 10
})

cljs.user> (test-map #inst "2013-12-19T05:00:00.000-00:00")
nil

2. Map with 8 elements

cljs.user> (def test-map
{
:a 1
:b 2
#inst "2013-12-19T05:00:00.000-00:00" 3
:d 4
:e 5
#inst "2013-12-06T05:00:00.000-00:00" 6
:g 7
:h 8
})

cljs.user> (test-map #inst "2013-12-19T05:00:00.000-00:00")
3

Activity

Hide
David Nolen added a comment -

This is because JS Dates don't hash consistently, http://dev.clojure.org/jira/browse/CLJS-523

Show
David Nolen added a comment - This is because JS Dates don't hash consistently, http://dev.clojure.org/jira/browse/CLJS-523

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: