dev_compiler
dev_compiler copied to clipboard
const list/map should be immutable
https://codereview.chromium.org/1099333002 fixes canonicalization but not immutability for literals of those two types.
we could use Object.freeze, that will protect the array from JS too
I tired out freeze, the catch is we can't throw expandos on the object later (like hashCode). Weak maps are one alternative, another is just to precompute identityHashCode and such.