Ignore:
Timestamp:
Jul 17, 2006, 2:06:57 AM (19 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.


  • Changed the initialize callback to run from least derived class (parent class) to most derived class. This enables C++ style initialization, and derived class overriding of member data.


  • Added excpetion propopgation to JSObjectMake, to support initialize exceptions, and generally round out our policy of making function signatures as long as possible.
  • API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're in C++ land now.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSObjectRef.h

    r15482 r15483  
    6767
    6868void Initialize(JSContextRef ctx, JSObjectRef object, JSValueRef* exception);
     69
     70Unlike the other object callbacks, the initialize callback is called on the least
     71derived class (the parent class) first, and the most derived class last.
    6972*/
    7073typedef void
     
    7881
    7982void Finalize(JSObjectRef object);
     83
     84The finalize callback is called on the most derived class first, and the least
     85derived class (the parent class) last.
    8086*/
    8187typedef void           
     
    225231@param exception A pointer to a JSValueRef in which to return an exception, if any.
    226232@result true if possibleInstance is an instance of constructor, otherwise false.
    227 
    228233@discussion If you named your function HasInstance, you would declare it like this:
    229234
     
    379384@param jsClass The JSClass to assign to the object. Pass NULL to use the default object class.
    380385@param prototype The prototype to assign to the object. Pass NULL to use the default object prototype.
     386@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
    381387@result A JSObject with the given class and prototype.
    382388*/
    383 JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, JSValueRef prototype);
     389JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, JSValueRef prototype, JSValueRef* exception);
    384390
    385391/*!
Note: See TracChangeset for help on using the changeset viewer.