[Webkit-unassigned] [Bug 32242] implement Object.getOwnPropertyNames()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 8 14:12:16 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32242





--- Comment #1 from Patrick Mueller <pmuellr at yahoo.com>  2009-12-08 14:12:16 PST ---
The implementation of this function should be the nearly the same as the
Object.keys() current implementation.  The difference between keys() and
getOwnPropertyNames() seems to be that keys() only returns enumerable
properties, and gOPN() returns all of them.

Looking at the keys() implementation in runtime/ObjectConstructor.cpp,
objectConstructorKeys(), it calls an internal getOwnPropertyNames() which
actually returns property names pre-filtered as enumerable.  Unfortunate name
choice there (oh well).  

Looks to me like Structure::getEnumerablePropertyNames() should probably be
generalized to take a boolean option on whether to include non-enumerable
properties or not, then the same function can be used for both the
Object.keys() and Object.getOwnPropertyNames() implementation.

-- 
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