W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] Bug in defineProperty

From: Evgeny Burzak <buzzilo@gmail.com>
Date: Thu, 4 Aug 2011 17:26:17 +0400
Message-ID: <CALj8=zdakE_TwzJTZ7X_Q=Vuvytu3nzRo5vzw=s=24bJhWo16w@mail.gmail.com>
Hello,

It seems there is a bug in function Object.defineProperty.
When property was defined with enumerable descriptor = false, I can
anyway get it in iterator if was defined prop with the same name in
object prototype.
Almost all browsers affected , except for Firefox. Maybe this happened
due to ambiguous definition?

Test

function test() {Object.defineProperty(this, "a", {value : "b",
                               writable : true,
                               enumerable : false,
                               configurable : true});
}
test.prototype.a = "c"
t = new test()
for(x in t) console.log([x, t[x]])

Results

IE9: a,b
Chrome: a,b
Safari: not tested
Opera: failed
Firefox: nothing - right job

-Evgeny
Received on Thursday, 4 August 2011 06:26:17 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC