Ignore:
Timestamp:
Sep 18, 2009, 4:12:03 PM (16 years ago)
Author:
[email protected]
Message:

Implement ES5 Object.defineProperty function
https://bugs.webkit.org/show_bug.cgi?id=29503

Reviewed by Geoff Garen

Implement Object.defineProperty. This requires adding the API to
ObjectConstructor, along with a helper function that implements the
ES5 internal ToPropertyDescriptor function. It then adds
JSObject::defineOwnProperty that implements the appropriate ES5 semantics.
Currently defineOwnProperty uses a delete followed by a put to redefine
attributes of a property, clearly this is less efficient than it could be
but we can improve this if it needs to be possible in future.

File:
1 edited

Legend:

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

    r48336 r48542  
    4545        virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&);
    4646        virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const;
    47         virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction);
    48         virtual void defineSetter(ExecState*, const Identifier& propertyName, JSObject* setterFunction);
     47        virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes);
     48        virtual void defineSetter(ExecState*, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes);
    4949        virtual JSValue lookupGetter(ExecState*, const Identifier& propertyName);
    5050        virtual JSValue lookupSetter(ExecState*, const Identifier& propertyName);
Note: See TracChangeset for help on using the changeset viewer.