Show
Ignore:
Timestamp:
07/16/06 15:17:04 (2 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.


  • Added names to functions.


  • Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors. The private data idiom is that a JS object stores its native implementation as private data. For functions and constructors, the native implementation is nothing more than the callback they already store, so supporting private data, too, confuses the idiom. If you *really* want, you can still create a custom function with private data.
  • API/JSCallbackConstructor.cpp:
  • API/JSCallbackConstructor.h:
  • API/JSCallbackFunction.cpp: (KJS::JSCallbackFunction::JSCallbackFunction):
  • API/JSCallbackFunction.h:
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::staticFunctionGetter):
  • API/JSObjectRef.cpp: (JSObjectMakeFunction): (JSObjectMakeFunctionWithBody): (JSObjectGetPrivate): (JSObjectSetPrivate):
  • API/JSObjectRef.h:
  • API/minidom.c: (main):
  • API/testapi.c: (main):
Files:
1 modified

Legend:

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

    r15468 r15469  
    2626 
    2727#include "APICast.h" 
     28#include "JSCallbackFunction.h" 
    2829#include "JSCallbackObject.h" 
    2930#include "JSStringRef.h" 
     
    406407        if (__JSClass::StaticFunctionsTable* staticFunctions = jsClass->staticFunctions) { 
    407408            if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) { 
    408                 JSValue* v = toJS(JSObjectMakeFunction(toRef(exec), entry->callAsFunction)); 
    409                 thisObj->putDirect(propertyName, v, entry->attributes); 
    410                 return v; 
     409                JSObject* o = new JSCallbackFunction(exec, entry->callAsFunction, propertyName); 
     410                thisObj->putDirect(propertyName, o, entry->attributes); 
     411                return o; 
    411412            } 
    412413        }