Changeset 15233 in webkit for trunk/JavaScriptCore/API/testapi.c


Ignore:
Timestamp:
Jul 8, 2006, 10:42:39 AM (19 years ago)
Author:
ggaren
Message:

Reviewed by TimO.

  • Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction, to match JSEvaluate.


  • API/JSObjectRef.cpp: (JSObjectCallAsFunction):
  • API/JSObjectRef.h:
  • API/testapi.c: (main):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/testapi.c

    r15225 r15233  
    602602    JSClassRelease(nullCallbacksClass);
    603603   
     604    functionBuf = JSStringBufferCreateUTF8("return this;");
     605    function = JSFunctionMakeWithBody(context, functionBuf, NULL, 1, NULL);
     606    JSStringBufferRelease(functionBuf);
     607    v = JSObjectCallAsFunction(context, function, NULL, 0, NULL, NULL);
     608    assert(JSValueIsEqual(context, v, globalObject));
     609    v = JSObjectCallAsFunction(context, function, o, 0, NULL, NULL);
     610    assert(JSValueIsEqual(context, v, o));
     611   
    604612    char* script = createStringWithContentsOfFile("testapi.js");
    605613    JSStringBufferRef scriptBuf = JSStringBufferCreateUTF8(script);
Note: See TracChangeset for help on using the changeset viewer.