Ignore:
Timestamp:
Jul 17, 2006, 1:14:39 AM (19 years ago)
Author:
mjs
Message:

Reviewed by Geoff.


  • add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations; except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.


Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
but usually uninteresting parameter.

  • API/JSBase.cpp: (JSEvaluateScript): (JSCheckScriptSyntax): (JSGarbageCollect):
  • API/JSBase.h:
  • API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject): (KJS::JSCallbackObject::init): (KJS::JSCallbackObject::getOwnPropertySlot): (KJS::JSCallbackObject::put): (KJS::JSCallbackObject::deleteProperty): (KJS::JSCallbackObject::toNumber): (KJS::JSCallbackObject::toString):
  • API/JSContextRef.cpp: (JSGlobalContextCreate): (JSGlobalContextRetain): (JSGlobalContextRelease): (JSContextGetGlobalObject):
  • API/JSContextRef.h:
  • API/JSNode.c: (JSNodePrototype_appendChild): (JSNodePrototype_removeChild): (JSNodePrototype_replaceChild): (JSNode_getNodeType): (JSNode_getFirstChild): (JSNode_prototype):
  • API/JSNodeList.c: (JSNodeListPrototype_item): (JSNodeList_length): (JSNodeList_getProperty): (JSNodeList_prototype):
  • API/JSObjectRef.cpp: (JSObjectMake): (JSObjectMakeFunctionWithCallback): (JSObjectMakeConstructor): (JSObjectMakeFunction): (JSObjectGetPrototype): (JSObjectSetPrototype): (JSObjectHasProperty): (JSObjectGetProperty): (JSObjectSetProperty): (JSObjectGetPropertyAtIndex): (JSObjectSetPropertyAtIndex): (JSObjectDeleteProperty): (JSObjectIsFunction): (JSObjectCallAsFunction): (JSObjectIsConstructor): (JSObjectCallAsConstructor): (JSObjectCopyPropertyNames):
  • API/JSObjectRef.h:
  • API/JSStringRef.cpp:
  • API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsObjectOfClass): (JSValueIsEqual): (JSValueIsStrictEqual): (JSValueIsInstanceOfConstructor): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): (JSValueMakeString): (JSValueToBoolean): (JSValueToNumber): (JSValueToStringCopy): (JSValueToObject): (JSValueProtect): (JSValueUnprotect):
  • API/JSValueRef.h:
  • API/minidom.c: (print):
  • API/testapi.c: (MyObject_getProperty): (MyObject_deleteProperty): (MyObject_callAsFunction): (MyObject_callAsConstructor): (MyObject_convertToType): (print_callAsFunction): (main):
File:
1 edited

Legend:

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

    r15437 r15481  
    4747
    4848    Interpreter* interpreter = new Interpreter(globalObject); // adds the built-in object prototype to the global object
    49     JSGlobalContextRef context = reinterpret_cast<JSGlobalContextRef>(interpreter->globalExec());
    50     return JSGlobalContextRetain(context);
     49    JSGlobalContextRef ctx = reinterpret_cast<JSGlobalContextRef>(interpreter->globalExec());
     50    return JSGlobalContextRetain(ctx);
    5151}
    5252
    53 JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef context)
     53JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx)
    5454{
    5555    JSLock lock;
    56     ExecState* exec = toJS(context);
     56    ExecState* exec = toJS(ctx);
    5757    exec->dynamicInterpreter()->ref();
    58     return context;
     58    return ctx;
    5959}
    6060
    61 void JSGlobalContextRelease(JSGlobalContextRef context)
     61void JSGlobalContextRelease(JSGlobalContextRef ctx)
    6262{
    6363    JSLock lock;
    64     ExecState* exec = toJS(context);
     64    ExecState* exec = toJS(ctx);
    6565    exec->dynamicInterpreter()->deref();
    6666}
    6767
    68 JSObjectRef JSContextGetGlobalObject(JSContextRef context)
     68JSObjectRef JSContextGetGlobalObject(JSContextRef ctx)
    6969{
    70     ExecState* exec = toJS(context);
     70    ExecState* exec = toJS(ctx);
    7171    return toRef(exec->dynamicInterpreter()->globalObject());
    7272}
Note: See TracChangeset for help on using the changeset viewer.