archives

« Bugzilla Issues Index

#1863 — Insufficient/Incorrect duplicate computed property key checks


Two issues:

(1) Order of computed and literal property keys should be irrelevant when reporting errors. That means the duplicate property key check needs to be performed for all kinds of property keys. (Obviously implementations are free to omit the check for all-literal-property-keys objects.)

js> "use strict"; ({a: 0, ["a"]: 0})
uncaught exception: TypeError: duplicate property-id: a
js> "use strict"; ({["a"]: 0, a: 0})
{a:0}


(2) The duplicate key check needs to use [[GetOwnProperty]] instead of [[HasOwnProperty]] for the accessor property case.

js> ({get ["x"](){}, set ["x"](v){}})
uncaught exception: TypeError: duplicate property-id: x


see https://mail.mozilla.org/pipermail/es-discuss/2013-October/034401.html

I pretty convinced that these dynamic checks are unnecessary and probably a bad idea. Unless there is overwhelming push to keep them, I'm going to remove them from the spec.


dynamic checks removed in rev20


fixed in rev20 draft, Oct. 28, 2013