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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 5 01:05:24 PST 2010


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





--- Comment #8 from Kent Hansen <kent.hansen at nokia.com>  2010-01-05 01:05:22 PST ---
(In reply to comment #7)
> I think a bool is better, for clarity.

Except getOwnProperties(..., true) isn't that readable.
This was brought up in the "unwritten rules of webkit style" thread on
webkit-dev at . One argument I remember was "if you're going to be passing bool
constants (i.e. not variables) as arguments to functions, prefer an enum".

The only use-case I have so far for calling getOwnPropertyNames() with the
non-default value is in the implementation of Object.getOwnPropertyNames, so
I'm not sure if that justifies using an enum.

The general form would be one of:

void getOwnPropertyNames(ExecState*, PropertyNameArray&, bool
includeNonEnumerable = false);

or:

enum EnumerationMode {
    EnumerateNormal,
    EnumerateAll
};

void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode =
EnumerateNormal);

(Not sure about the best name for the enum)
I tend to prefer the bool for the reasons you gave.

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