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/JSContextRef.cpp

    r15310 r15317  
    102102    return true;
    103103}
    104 
    105 JSValueRef JSContextGetException(JSContextRef context)
    106 {
    107     ExecState* exec = toJS(context);
    108     return toRef(exec->exception());
    109 }
    110 
    111 void JSContextClearException(JSContextRef context)
    112 {
    113     ExecState* exec = toJS(context);
    114     if (exec->hadException())
    115         exec->clearException();
    116 }
    117 
    118 void JSContextSetException(JSContextRef context, JSValueRef value)
    119 {
    120     ExecState* exec = toJS(context);
    121     JSValue* jsValue = toJS(value);
    122     exec->setException(jsValue);
    123 }
Note: See TracChangeset for help on using the changeset viewer.