3 ms·
Unfortunately their hash table uses Javascript objects. Therefore it does not behave exactly like Ruby. Eg: # Opal h = Hash.new h['0'] = 1 h[0] = 2
by vjeux 14y ago
Unfortunately their hash table uses Javascript objects. Therefore it does not behave exactly like Ruby.
Eg:
# Opal
h = Hash.new
h['0'] = 1
h[0] = 2
print h
# {"0"=>2}
# Ruby
h = Hash.new
h['0'] = 1
h[0] = 2
print h
# {"0"=>1, 0=>2}
It is very hard to reproduce those low level specifications without rebuilding everything from scratch sadly :(
- lucian1900 14y agoECMA5 has real maps, which Opal could use. Some browsers support them already.