Property / Literal stealing using Object.defineProperty

Mike Shaver mike.shaver at gmail.com
Thu Dec 30 10:33:46 PST 2010


On Thu, Dec 30, 2010 at 9:15 AM, Allen Wirfs-Brock
<allen at wirfs-brock.com> wrote:
> Chrome is non-compliant with the ES5 spec. in this regard.
>
> The specification of object literals in section 11.1.5 uses [[DefineOwnProperty]] to install object literal properties.  It is not supposed to trigger any inherited get/set functions.
>
> Try it in FF4 or Safari 5.0.3 or a IE9 preview to see the correct behavior.

Yeah, we actually had to fix this in FF3.5 (2 years ago!) to deal with
JSON data leaks based on our getter/setter extensions:

https://developer.mozilla.org/web-tech/2009/04/29/object-and-array-initializers-should-not-invoke-setters-when-evaluated/

Mike


More information about the es-discuss mailing list