Changeset 14932 in webkit for trunk/JavaScriptCore


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:]):
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r14913 r14932  
     12006-06-20  Timothy Hatcher  <[email protected]>
     2
     3        Reviewed by Geoff.
     4
     5        Make sure we clear the exception before returning so
     6        that future calls will not fail because of an earlier
     7        exception state. Assert on entry that the WebScriptObject
     8        is working with an ExecState that dose not have an exception.
     9        Document that evaluateWebScript and callWebScriptMethod return
     10        WebUndefined when an exception is thrown.
     11
     12        * bindings/objc/WebScriptObject.h:
     13        * bindings/objc/WebScriptObject.mm:
     14        (-[WebScriptObject callWebScriptMethod:withArguments:]):
     15        (-[WebScriptObject evaluateWebScript:]):
     16        (-[WebScriptObject setValue:forKey:]):
     17        (-[WebScriptObject valueForKey:]):
     18        (-[WebScriptObject removeWebScriptKey:]):
     19        (-[WebScriptObject webScriptValueAtIndex:]):
     20        (-[WebScriptObject setWebScriptValueAtIndex:value:]):
     21
    1222006-06-19  Anders Carlsson  <[email protected]>
    223
  • trunk/JavaScriptCore/bindings/objc/WebScriptObject.h

    r13610 r14932  
    188188    specified arguments.
    189189    @result Returns the result of calling the script method.
     190    Returns WebUndefined when an exception is thrown in the script environment.
    190191*/
    191192- (id)callWebScriptMethod:(NSString *)name withArguments:(NSArray *)args;
     
    197198    of the script is dependent of the target script environment.
    198199    @result Returns the result of evaluating the script in the script environment.
     200    Returns WebUndefined when an exception is thrown in the script environment.
    199201*/
    200202- (id)evaluateWebScript:(NSString *)script;
     
    219221    @param index The index of the property to return.  Index based access is dependent
    220222    @discussion Gets the value of the property at the specified index.
    221     @result The value of the property.
     223    @result The value of the property. Returns WebUndefined when an exception is
     224    thrown in the script environment.
    222225*/
    223226- (id)webScriptValueAtIndex:(unsigned int)index;
  • 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.