Ignore:
Timestamp:
Jun 20, 2006, 5:20:00 PM (19 years ago)
Author:
thatcher
Message:

Reviewed by Geoff.

Make sure we clear the exception before returning so
that future calls will not fail because of an earlier
exception state. Assert on entry that the WebScriptObject
is working with an ExecState that dose not have an exception.
Document that evaluateWebScript and callWebScriptMethod return
WebUndefined when an exception is thrown.

  • bindings/objc/WebScriptObject.h:
  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): (-[WebScriptObject evaluateWebScript:]): (-[WebScriptObject setValue:forKey:]): (-[WebScriptObject valueForKey:]): (-[WebScriptObject removeWebScriptKey:]): (-[WebScriptObject webScriptValueAtIndex:]): (-[WebScriptObject setWebScriptValueAtIndex:value:]):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/objc/WebScriptObject.mm

    r14836 r14932  
    176176    // Lookup the function object.
    177177    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     178    ASSERT(!exec->hadException());
    178179
    179180    JSLock lock;
     
    197198        LOG_EXCEPTION (exec);
    198199        result = jsUndefined();
     200        exec->clearException();
    199201    }
    200202
     
    216218   
    217219    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     220    ASSERT(!exec->hadException());
     221
    218222    JSValue *result;
    219    
    220223    JSLock lock;
    221224   
     
    234237        LOG_EXCEPTION (exec);
    235238        result = jsUndefined();
     239        exec->clearException();
    236240    }
    237241   
     
    252256
    253257    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     258    ASSERT(!exec->hadException());
    254259
    255260    JSLock lock;
     
    259264    if (exec->hadException()) {
    260265        LOG_EXCEPTION (exec);
     266        exec->clearException();
    261267    }
    262268
     
    273279
    274280    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     281    ASSERT(!exec->hadException());
    275282
    276283    JSLock lock;
     
    281288        LOG_EXCEPTION (exec);
    282289        result = jsUndefined();
     290        exec->clearException();
    283291    }
    284292
     
    301309
    302310    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     311    ASSERT(!exec->hadException());
    303312
    304313    JSLock lock;
     
    308317    if (exec->hadException()) {
    309318        LOG_EXCEPTION (exec);
     319        exec->clearException();
    310320    }
    311321
     
    341351
    342352    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     353    ASSERT(!exec->hadException());
     354
    343355    JSLock lock;
    344356    JSValue *result = [self _imp]->get (exec, (unsigned)index);
     
    347359        LOG_EXCEPTION (exec);
    348360        result = jsUndefined();
     361        exec->clearException();
    349362    }
    350363
     
    365378
    366379    ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     380    ASSERT(!exec->hadException());
     381
    367382    JSLock lock;
    368383    [self _imp]->put (exec, (unsigned)index, (convertObjcValueToValue(exec, &value, ObjcObjectType)));
     
    370385    if (exec->hadException()) {
    371386        LOG_EXCEPTION (exec);
     387        exec->clearException();
    372388    }
    373389
Note: See TracChangeset for help on using the changeset viewer.