Ignore:
Timestamp:
Jul 15, 2006, 6:28:25 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.

  • Moved the arguments passed to JSClassCreate into a single structure, called JSClassDefinition. This will enable easier structure migration/versioning in the future, if necessary.


  • Added support for class names.


  • kJSClassDefinitionNull replaces kJSObjectCallbacksNone.


  • JSClass is becoming a fairly complex struct, so I migrated all of its implementation other than reference counting to the sruct.


  • Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're declared in JSObjectRef.h


  • Also added some more informative explanation to the class structure doc.
File:
1 edited

Legend:

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

    r15376 r15462  
    5454
    5555struct __JSClass {
    56     __JSClass()
    57         : refCount(0), staticValues(0), staticFunctions(0)
    58     {
    59     }
    60    
    61     unsigned refCount;
     56    __JSClass(JSClassDefinition*);
     57    ~__JSClass();
    6258   
    6359    typedef HashMap<RefPtr<KJS::UString::Rep>, StaticValueEntry*> StaticValuesTable;
     60    typedef HashMap<RefPtr<KJS::UString::Rep>, StaticFunctionEntry*> StaticFunctionsTable;
     61
     62    unsigned refCount;
     63
     64    KJS::UString className;
     65    __JSClass* parentClass;
     66       
    6467    StaticValuesTable* staticValues;
    65 
    66     typedef HashMap<RefPtr<KJS::UString::Rep>, StaticFunctionEntry*> StaticFunctionsTable;
    6768    StaticFunctionsTable* staticFunctions;
    68 
    69     KJS::UString name; // FIXME: Not used yet
    70     JSObjectCallbacks callbacks;
    71     __JSClass* parent;
     69   
     70    JSObjectInitializeCallback initialize;
     71    JSObjectFinalizeCallback finalize;
     72    JSObjectHasPropertyCallback hasProperty;
     73    JSObjectGetPropertyCallback getProperty;
     74    JSObjectSetPropertyCallback setProperty;
     75    JSObjectDeletePropertyCallback deleteProperty;
     76    JSObjectAddPropertiesToListCallback addPropertiesToList;
     77    JSObjectCallAsFunctionCallback callAsFunction;
     78    JSObjectCallAsConstructorCallback callAsConstructor;
     79    JSObjectHasInstanceCallback hasInstance;
     80    JSObjectConvertToTypeCallback convertToType;
    7281};
    7382
Note: See TracChangeset for help on using the changeset viewer.