Ignore:
Timestamp:
Jul 10, 2006, 5:26:25 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Darin.


Added exception out parameter to API object callbacks, removed semi-bogus
JSContext(.*)Exception functions.


To make these calls syntactically simple, I added an exceptionSlot()
method to the ExecState class, which provides a JSValue slot in which to
store a JSValue* exception.

  • API/APICast.h: (toRef):
  • API/JSCallbackConstructor.cpp: (KJS::JSCallbackConstructor::construct):
  • API/JSCallbackFunction.cpp: (KJS::JSCallbackFunction::callAsFunction):
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::init): (KJS::JSCallbackObject::getOwnPropertySlot): (KJS::JSCallbackObject::put): (KJS::JSCallbackObject::deleteProperty): (KJS::JSCallbackObject::construct): (KJS::JSCallbackObject::callAsFunction): (KJS::JSCallbackObject::getPropertyList): (KJS::JSCallbackObject::toBoolean): (KJS::JSCallbackObject::toNumber): (KJS::JSCallbackObject::toString): (KJS::JSCallbackObject::staticValueGetter): (KJS::JSCallbackObject::callbackGetter):
  • API/JSContextRef.cpp: (JSCheckSyntax):
  • API/JSContextRef.h:
  • API/JSNode.c: (JSNodePrototype_appendChild): (JSNodePrototype_removeChild): (JSNodePrototype_replaceChild): (JSNode_getNodeType): (JSNode_getChildNodes): (JSNode_getFirstChild): (JSNode_construct):
  • API/JSNode.h:
  • API/JSNodeList.c: (JSNodeListPrototype_item): (JSNodeList_length): (JSNodeList_getProperty):
  • API/JSObjectRef.h:
  • API/minidom.c: (print):
  • API/testapi.c: (MyObject_initialize): (MyObject_hasProperty): (MyObject_getProperty): (MyObject_setProperty): (MyObject_deleteProperty): (MyObject_getPropertyList): (MyObject_callAsFunction): (MyObject_callAsConstructor): (MyObject_convertToType): (print_callAsFunction): (myConstructor_callAsConstructor): (main):
  • JavaScriptCore.exp:
  • kjs/ExecState.h: (KJS::ExecState::exceptionHandle):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSCallbackFunction.cpp

    r15310 r15317  
    5555    for (size_t i = 0; i < argc; i++)
    5656        argv[i] = toRef(args[i]);
    57     return toJS(m_callback(execRef, thisRef, thisObjRef, argc, argv));
     57    return toJS(m_callback(execRef, thisRef, thisObjRef, argc, argv, toRef(exec->exceptionSlot())));
    5858}
    5959
Note: See TracChangeset for help on using the changeset viewer.