Immutable-js: infinite loop hashing Infinity

Created on 24 Feb 2016  路  3Comments  路  Source: immutable-js/immutable-js

It seems that causing Immutable to hash Infinity triggers an infinite loop (makes sense I suppose :smirk:).

I can reproduce in Chrome and Firefox from the console on the doc site.

m = Immutable.Map({test: Infinity});
m.hasCode() // spins forever

I haven't really dug into the hasher. If it's not possible to hash infinity, I'd at least expect to see an exception.

cc @marcneuwirth

bug

Most helpful comment

Haha, nice one. If hashing Infinity takes forever, does hashing -Infinity... reverse time? Let's not even try it just to be safe ;)

All 3 comments

Haha, nice one. If hashing Infinity takes forever, does hashing -Infinity... reverse time? Let's not even try it just to be safe ;)

Good find.

thanks @leebyron 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesgpearce picture jamesgpearce  路  4Comments

Delapouite picture Delapouite  路  3Comments

jbonta picture jbonta  路  3Comments

coodoo picture coodoo  路  3Comments

migueloller picture migueloller  路  3Comments