Implicitly add toString and valueOf to prototype when convertToType callback is provided
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 19:02:03 +0000 (19:02 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 19:02:03 +0000 (19:02 +0000)
commit456734e479b49f6f36b768cedc3edab2aa11a7b3
treea721ecd5562f61df348071d098e8a7f3b109e364
parentf581928d56178a67eef21c5f6763e63add936b27
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/API/JSCallbackFunction.cpp
Source/JavaScriptCore/API/JSCallbackFunction.h
Source/JavaScriptCore/API/JSClassRef.cpp
Source/JavaScriptCore/API/tests/testapi.js
Source/JavaScriptCore/ChangeLog