Ignore:
Timestamp:
May 3, 2009, 2:02:04 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-05-02 Sam Weinig <[email protected]>

Roll JSC API number marshaling back in one last time (I hope).

WebCore:

2009-05-03 Sam Weinig <[email protected]>

Roll JSC API number marshaling back in one last time (I hope).

File:
1 edited

Legend:

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

    r43158 r43160  
    131131    if (exec->hadException()) {
    132132        if (exception)
    133             *exception = toRef(exec->exception());
     133            *exception = toRef(exec, exec->exception());
    134134        exec->clearException();
    135135        result = 0;
     
    148148        MarkedArgumentBuffer argList;
    149149        for (size_t i = 0; i < argumentCount; ++i)
    150             argList.append(toJS(arguments[i]));
     150            argList.append(toJS(exec, arguments[i]));
    151151
    152152        result = constructArray(exec, argList);
     
    156156    if (exec->hadException()) {
    157157        if (exception)
    158             *exception = toRef(exec->exception());
     158            *exception = toRef(exec, exec->exception());
    159159        exec->clearException();
    160160        result = 0;
     
    172172    MarkedArgumentBuffer argList;
    173173    for (size_t i = 0; i < argumentCount; ++i)
    174         argList.append(toJS(arguments[i]));
     174        argList.append(toJS(exec, arguments[i]));
    175175
    176176    JSObject* result = constructDate(exec, argList);
    177177    if (exec->hadException()) {
    178178        if (exception)
    179             *exception = toRef(exec->exception());
     179            *exception = toRef(exec, exec->exception());
    180180        exec->clearException();
    181181        result = 0;
     
    193193    MarkedArgumentBuffer argList;
    194194    for (size_t i = 0; i < argumentCount; ++i)
    195         argList.append(toJS(arguments[i]));
     195        argList.append(toJS(exec, arguments[i]));
    196196
    197197    JSObject* result = constructError(exec, argList);
    198198    if (exec->hadException()) {
    199199        if (exception)
    200             *exception = toRef(exec->exception());
     200            *exception = toRef(exec, exec->exception());
    201201        exec->clearException();
    202202        result = 0;
     
    214214    MarkedArgumentBuffer argList;
    215215    for (size_t i = 0; i < argumentCount; ++i)
    216         argList.append(toJS(arguments[i]));
     216        argList.append(toJS(exec, arguments[i]));
    217217
    218218    JSObject* result = constructRegExp(exec, argList);
    219219    if (exec->hadException()) {
    220220        if (exception)
    221             *exception = toRef(exec->exception());
     221            *exception = toRef(exec, exec->exception());
    222222        exec->clearException();
    223223        result = 0;
     
    227227}
    228228
    229 JSValueRef JSObjectGetPrototype(JSContextRef, JSObjectRef object)
    230 {
    231     JSObject* jsObject = toJS(object);
    232     return toRef(jsObject->prototype());
    233 }
    234 
    235 void JSObjectSetPrototype(JSContextRef, JSObjectRef object, JSValueRef value)
    236 {
    237     JSObject* jsObject = toJS(object);
    238     JSValue jsValue = toJS(value);
     229JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object)
     230{
     231    ExecState* exec = toJS(ctx);
     232    exec->globalData().heap.registerThread();
     233    JSLock lock(exec);
     234
     235    JSObject* jsObject = toJS(object);
     236    return toRef(exec, jsObject->prototype());
     237}
     238
     239void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value)
     240{
     241    ExecState* exec = toJS(ctx);
     242    exec->globalData().heap.registerThread();
     243    JSLock lock(exec);
     244
     245    JSObject* jsObject = toJS(object);
     246    JSValue jsValue = toJS(exec, value);
    239247
    240248    jsObject->setPrototype(jsValue.isObject() ? jsValue : jsNull());
     
    263271    if (exec->hadException()) {
    264272        if (exception)
    265             *exception = toRef(exec->exception());
    266         exec->clearException();
    267     }
    268     return toRef(jsValue);
     273            *exception = toRef(exec, exec->exception());
     274        exec->clearException();
     275    }
     276    return toRef(exec, jsValue);
    269277}
    270278
     
    277285    JSObject* jsObject = toJS(object);
    278286    Identifier name(propertyName->identifier(&exec->globalData()));
    279     JSValue jsValue = toJS(value);
     287    JSValue jsValue = toJS(exec, value);
    280288
    281289    if (attributes && !jsObject->hasProperty(exec, name))
     
    288296    if (exec->hadException()) {
    289297        if (exception)
    290             *exception = toRef(exec->exception());
     298            *exception = toRef(exec, exec->exception());
    291299        exec->clearException();
    292300    }
     
    304312    if (exec->hadException()) {
    305313        if (exception)
    306             *exception = toRef(exec->exception());
    307         exec->clearException();
    308     }
    309     return toRef(jsValue);
     314            *exception = toRef(exec, exec->exception());
     315        exec->clearException();
     316    }
     317    return toRef(exec, jsValue);
    310318}
    311319
     
    318326
    319327    JSObject* jsObject = toJS(object);
    320     JSValue jsValue = toJS(value);
     328    JSValue jsValue = toJS(exec, value);
    321329   
    322330    jsObject->put(exec, propertyIndex, jsValue);
    323331    if (exec->hadException()) {
    324332        if (exception)
    325             *exception = toRef(exec->exception());
     333            *exception = toRef(exec, exec->exception());
    326334        exec->clearException();
    327335    }
     
    339347    if (exec->hadException()) {
    340348        if (exception)
    341             *exception = toRef(exec->exception());
     349            *exception = toRef(exec, exec->exception());
    342350        exec->clearException();
    343351    }
     
    392400    MarkedArgumentBuffer argList;
    393401    for (size_t i = 0; i < argumentCount; i++)
    394         argList.append(toJS(arguments[i]));
     402        argList.append(toJS(exec, arguments[i]));
    395403
    396404    CallData callData;
     
    399407        return 0;
    400408
    401     JSValueRef result = toRef(call(exec, jsObject, callType, callData, jsThisObject, argList));
    402     if (exec->hadException()) {
    403         if (exception)
    404             *exception = toRef(exec->exception());
     409    JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList));
     410    if (exec->hadException()) {
     411        if (exception)
     412            *exception = toRef(exec, exec->exception());
    405413        exec->clearException();
    406414        result = 0;
     
    431439    MarkedArgumentBuffer argList;
    432440    for (size_t i = 0; i < argumentCount; i++)
    433         argList.append(toJS(arguments[i]));
     441        argList.append(toJS(exec, arguments[i]));
    434442    JSObjectRef result = toRef(construct(exec, jsObject, constructType, constructData, argList));
    435443    if (exec->hadException()) {
    436444        if (exception)
    437             *exception = toRef(exec->exception());
     445            *exception = toRef(exec, exec->exception());
    438446        exec->clearException();
    439447        result = 0;
Note: See TracChangeset for help on using the changeset viewer.