Status: New
Owner: ----
New issue 705 by erights: Non-enumerable property fails to shadow inherited
enumerable property from for-in
http://code.google.com/p/v8/issues/detail?id=705
At https://mail.mozilla.org/pipermail/es5-discuss/2010-May/003536.html
Allen clarifies that, according to the ES5 spec,
function showProps(obj) {
var result = [];
for (var k in obj) {
result.push(k, ': ', ''+obj[k], '\n');
}
return result.join('');
}
var base = {x:8};
var derived = Object.create(base, {x: {value: 9, enumerable: false}});
showProps(derived);
Should print the empty string. On Chrome 5.0.375.38 beta, it prints "x: 9".
Besides violating the spec, it is also the less useful behavior for the
common for-in loop behavior (shown above as "obj[k]") of using the key to
index into the object being iterated, in order to get the corresponding
value.
The corresponding WebKit bug is at
https://bugs.webkit.org/show_bug.cgi?id=38970
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev