Changeset 48336 in webkit for trunk/JavaScriptCore/debugger


Ignore:
Timestamp:
Sep 12, 2009, 7:44:32 PM (16 years ago)
Author:
[email protected]
Message:

[ES5] Implement Object.keys
https://bugs.webkit.org/show_bug.cgi?id=29170

Reviewed by Maciej Stachowiak.

This patch basically requires two separate steps, the first is to split getPropertyNames
into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave
in the same way as getOwnPropertySlot and getPropertySlot. In essence getOwnPropertyNames
produces the list of properties on an object excluding its prototype chain and getPropertyNames
just iterates the the object and its prototype chain calling getOwnPropertyNames at each level.

Location:
trunk/JavaScriptCore/debugger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/debugger/DebuggerActivation.cpp

    r47022 r48336  
    7272}
    7373
    74 void DebuggerActivation::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
     74void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
    7575{
    7676    m_activation->getPropertyNames(exec, propertyNames);
  • trunk/JavaScriptCore/debugger/DebuggerActivation.h

    r48331 r48336  
    4343        virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
    4444        virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
    45         virtual void getPropertyNames(ExecState*, PropertyNameArray&);
     45        virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&);
    4646        virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const;
    4747        virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction);
Note: See TracChangeset for help on using the changeset viewer.