[Webkit-unassigned] [Bug 38970] New: Non-enumerable property fails to shadow inherited enumerable property from for-in
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 11 22:20:40 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=38970
Summary: Non-enumerable property fails to shadow inherited
enumerable property from for-in
Product: WebKit
Version: 528+ (Nightly build)
Platform: Macintosh Intel
URL: https://mail.mozilla.org/pipermail/es5-discuss/2010-Ma
y/003536.html
OS/Version: Mac OS X 10.5
Status: UNCONFIRMED
Severity: Minor
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: erights at gmail.com
CC: erights at gmail.com
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 WebKit nightly as of this writing, 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.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list