Ignore:
Timestamp:
Oct 4, 2011, 12:02:03 PM (14 years ago)
Author:
[email protected]
Message:

Implicitly add toString and valueOf to prototype when convertToType callback is provided
https://bugs.webkit.org/show_bug.cgi?id=69156

Reviewed by Geoffrey Garen.

Added callbacks for toString and valueOf which are implicitly added to a client object's
prototype if they provide a convertToType callback when declaring their class through
the JSC API.

  • API/JSCallbackFunction.cpp:

(JSC::JSCallbackFunction::toStringCallback):
(JSC::JSCallbackFunction::valueOfCallback):

  • API/JSCallbackFunction.h:
  • API/JSClassRef.cpp:

(OpaqueJSClass::prototype):

  • API/tests/testapi.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r96164 r96627  
    5656    }
    5757
     58    static JSValueRef toStringCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     59    static JSValueRef valueOfCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     60
    5861private:
    5962    virtual CallType getCallDataVirtual(CallData&);
Note: See TracChangeset for help on using the changeset viewer.