[Webkit-unassigned] [Bug 29005] The values of RuntimeArray are not enumerable

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 7 09:40:37 PST 2009


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darin at apple.com




--- Comment #18 from Darin Adler <darin at apple.com>  2009-12-07 09:40:36 PST ---
(In reply to comment #16)
> Oliver, could you please describe in which cases getPropertyNames() is
> appropriate?

I'm not sure this is an entirely pertinent question, but I'll try to answer.

The getPropertyNames function is a loop that calls getOwnPropertyNames on all
the objects in the prototype chain.

To add properties, it would never be good to override getPropertyNames, because
it would create properties that you can see when enumerating the entire chain,
but not when looking at an individual object with the getOwnPropertyNames code
path.

The overrides of getPropertyNames inside the bridge directory in classes like
RuntimeObjectImp, CInstance, and QTInstance are almost certainly all indicative
of bugs that should be fixed.

The code in RuntimeObjectImp::getPropertyNames should probably be moved to
RuntimeObjectImp::getOwnPropertyNames, and in fact the code in the latter looks
like it will just cause an infinite loop and stack exhaustion. The trick here
is finding a way to test.

Similar with CInstance::getPropertyNames and QtInstance::getPropertyNames.

JSDOMWindow overrides getPropertyNames because it wants to control access to
the properties of its prototypes. That’s probably OK. It's a workaround for the
fact that the call to get the prototype inside the getPropertyNames function
doesn't have a convenient hook to allow the object to control access to the
prototype.

Long term we might decide that getPropertyNames shouldn't even be a virtual
function.

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