But now anything that does not override hash will have some problems
I had a quick look at the Javascript implementations of the other const classes in sys, and the following don't seem to have hash() implementations either:
Bool
Charset
Decimal
Enum
Log
Pod
Slot
TimeZone
Type
Do these need updating too?
andyThu 24 Nov 2016
Yes most likely - let me run through them and see - thanks Steve
SlimerDude Sat 19 Nov 2016
A simple program that keeps calling
Map.getOrAdd()
until the same key is added:Works fine in Java and only adds
key
the once:But enters an infinite loop in Javascript:
Note it works fine if you change the map to a primitive key, such as:
andy Mon 21 Nov 2016
Are you working off tip?
SlimerDude Mon 21 Nov 2016
It was 1.0.69, but I've just compiled
tip
and I'm still seeing the issue when I run the example in a browser.andy Mon 21 Nov 2016
Ticket promoted to #2577 and assigned to andy
Yeah - actually my last fix to "fix" it - actually broke it :)
Obj.hash used to return
0
- which would cause some interesting things to happen :) So I fixed that to return an increasing id by default.But now anything that did not override
hash
will have some problems - in this case its Uri. Should be an easy fix - I'll look tomorrow.andy Tue 22 Nov 2016
Ticket resolved in 1.0.70
Fixed - changeset
SlimerDude Tue 22 Nov 2016
Hi,
Cool!
I had a quick look at the Javascript implementations of the other
const
classes insys
, and the following don't seem to havehash()
implementations either:Bool
Charset
Decimal
Enum
Log
Pod
Slot
TimeZone
Type
Do these need updating too?
andy Thu 24 Nov 2016
Yes most likely - let me run through them and see - thanks Steve
andy Thu 8 Jun 2017
Fixed Bool and Decimal - others look ok