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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 30 04:55:46 PST 2009


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





--- Comment #4 from Kent Hansen <kent.hansen at nokia.com>  2009-12-30 04:55:45 PST ---
Hi Patrick, great that you've been looking into this!

You pretty much arrived at the same conclusion as I did. Yes, you will have to
modify dozens of files when adding a bool enumerable flag to
getOwnPropertyNames(). (And yes, you will need to modify the JS bindings code
generator, too.)
Yes, it feels rather intrusive. But I'm not convinced there's a better way.

I don't think it's sufficient to only provide enumeration for non-native
objects. getOwnPropertyNames() needs to work for Array, String and arguments
objects, for example.

A less intrusive approach might be to introduce a dedicated virtual function
for getting non-enumerable property names; e.g.
getOwnNonEnumerablePropertyNames(). You'd still need to actually reimplement
that function in most of the classes you list in comment #2, in order to fully
support Object.getOwnPropertyNames() for all types of object.

Finally, I agree that Structure::getEnumerablePropertyNames() should be
generalized to take a flag. Or rather, it should simply call a helper function,
e.g. Structure::getPropertyNames(EnumerablePropertiesOnly).

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