Changeset 9767 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Jul 14, 2005, 11:13:50 AM (20 years ago)
Author:
ggaren
Message:

-fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
throw statements fail inside eval statements

Reviewed by mjs.

  • kjs/function.cpp: (KJS::GlobalFuncImp::call): Big change since I fixed the tabbing. The important part is: if (c.complType() == Throw) exec->setException(c.value());
  • kjs/nodes.cpp: (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION (TryNode::execute): try now clears the exception state before the finally block executes, and checks the state after the block executes, so that exceptions in finally code get caught.
  • tests/mozilla/expected.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r9558 r9767  
    25912591  KJS_CHECKEXCEPTION
    25922592
    2593   // bail out on error
    2594   KJS_CHECKEXCEPTION
    2595 
    25962593  return Completion(Throw, v);
    25972594}
     
    27082705
    27092706  if (!_catch) {
     2707    Value lastException = exec->exception();
     2708    exec->clearException();
     2709   
    27102710    c2 = _final->execute(exec);
     2711   
     2712    if (!exec->hadException())
     2713      exec->setException(lastException);
     2714   
    27112715    return (c2.complType() == Normal) ? c : c2;
    27122716  }
Note: See TracChangeset for help on using the changeset viewer.