<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[185259] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/185259">185259</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2015-06-05 11:52:12 -0700 (Fri, 05 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>finally blocks should not set the exception stack trace when re-throwing the exception.
https://bugs.webkit.org/show_bug.cgi?id=145525

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

How exceptions presently work:
=============================
1. op_throw can throw any JSValue.
2. the VM tries to capture the stack at the throw point and propagate that as needed.
3. finally blocks are implemented using op_catch to catch the thrown value, and throws it again using op_throw.

What's wrong with how it presently works:
========================================
1. finally's makes for bad exception throw line numbers in the Inspector console.

   The op_throw in finally will throw the value anew i.e. it captures a stack from the re-throw point.
   As a result, the Inspector sees the finally block as the throw point.  The original stack is lost.

2. finally's breaks the Inspector's &quot;Breaks on Uncaught Exception&quot;

   This is because finally blocks are indistinguishable from catch blocks.  As a result, a try-finally,
   which should break in the Inspector on the throw, does not because the Inspector thought the
   exception was &quot;caught&quot;.

3. finally's yields confusing break points when the Inspector &quot;Breaks on All Exceptions&quot;

   a. In a try-finally scenario, the Inspector breaks 2 times: 1 at the throw, 1 at the finally.
   b. In a for-of loop (which has synthesized finallys), the Inspector will do another break.
      Similarly for other cases of JS code which synthesize finallys.
   c. At VM re-entry boundaries (e.g. js throws &amp; returns to native code, which returns to js),
      the Inspector will do another break if there's an uncaught exception.

How this patch fixes the issues:
===============================
1. We introduce an Exception object that wraps the thrown value and the exception stack.

   When throwing an exception, the VM will check if the thrown value is an Exception
   object or not.  If it is not an Exception object, then we must be throwing a new
   exception.  The VM will create an Exception object to wrap the thrown value and
   capture the current stack for it.

   If the thrown value is already an Exception object, then the requested throw operation
   must be a re-throw.  The VM will not capture a new stack for it.

2. op_catch will now populate 2 locals: 1 for the Exception, 1 for the thrown JSValue.

   The VM is aware of the Exception object and uses it for rethrows in finally blocks.
   JS source code is never aware of the Exception object.

   JS code is aware of the thrown value.  If it throws the caught thrown value, that
   constitutes a new throw, and a new Exception object will be created for it.

3. The VM no longer tracks the thrown JSValue and the exception stack.  It will only
   track a m_exception field which is an Exception*.

4. The BytecodeGenerator has already been updated in a prior patch to distinguish
   between Catch, Finally, and SynthesizedFinally blocks.  The interpreter runtime will
   now report to the debugger whether we have a Catch handler, not just any handlers.

   The debugger will use this detail to determine whether to break or not.  &quot;Break on
   uncaught exceptions&quot; will only break if no Catch handler was found.

   This solves the issue of the debugger breaking at finally blocks, and for-of statements.

5. The Exception object will also have a flag to indicate whether the debugger has been
   notified of the Exception being thrown.  Once the Interpreter notifies the debugger
   of the Exception object, it will mark this flag and not repeat the notify the debugger
   again of the same Exception.

   This solves the issue of the debugger breaking at VM re-entry points due to uncaught
   exceptions.

6. The life-cycle of the captured exception stack trace will now follow the life-cycle
   of the Exception object.

Other changes:
7. Change all clients of the VM::exception() to expect an Exception* instead of JSValue.

8. Fixed a few bugs where thrown exceptions are not cleared before exiting the VM.

9. Also renamed some variables and classes to better describe what they are.

* API/JSBase.cpp:
(JSEvaluateScript):
(JSCheckScriptSyntax):

* API/JSObjectRef.cpp:
(handleExceptionIfNeeded):
- The functions below all do the same exception check.  Added this helper
  to simplify the code.
(JSClassCreate):
(JSObjectMakeFunction):
(JSObjectMakeArray):
(JSObjectMakeDate):
(JSObjectMakeError):
(JSObjectMakeRegExp):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):

* API/JSScriptRef.cpp:
* API/JSValue.mm:
(JSContainerConvertor::take):
(reportExceptionToInspector):

* API/JSValueRef.cpp:
(handleExceptionIfNeeded):
- The functions below all do the same exception check.  Added this helper
  to simplify the code.
(evernoteHackNeeded):
(JSValueIsEqual):
(JSValueIsInstanceOfConstructor):
(JSValueCreateJSONString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
- Added new files Exception.h and Exception.cpp.

* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptFunctionCall::call):
* bindings/ScriptFunctionCall.h:

* bytecode/BytecodeList.json:
- op_catch now had 2 operands: the exception register, and the thrown value register.

* bytecode/BytecodeUseDef.h:
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::handlerForBytecodeOffset):
* bytecode/CodeBlock.h:
- handlerForBytecodeOffset() now can look for just Catch handlers only.

* bytecode/HandlerInfo.h:
- Cleaned up some white space I accidentally added in a previous patch.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::pushTry):
(JSC::BytecodeGenerator::popTryAndEmitCatch):
(JSC::BytecodeGenerator::emitThrowReferenceError):
(JSC::BytecodeGenerator::emitEnumeration):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitThrow):
* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):
- Adding support for op_catch's 2 operands.

* debugger/Debugger.cpp:
(JSC::Debugger::hasBreakpoint):
(JSC::Debugger::pauseIfNeeded):
(JSC::Debugger::exception):
* debugger/Debugger.h:
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::thisValue):
(JSC::DebuggerCallFrame::evaluate):
* debugger/DebuggerCallFrame.h:
(JSC::DebuggerCallFrame::isValid):
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript):
* inspector/InspectorEnvironment.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectScriptDebugServer.h:
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluate):
* inspector/JavaScriptCallFrame.h:
(Inspector::JavaScriptCallFrame::vmEntryGlobalObject):
(Inspector::JavaScriptCallFrame::thisValue):
(Inspector::JavaScriptCallFrame::evaluate):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::extractSourceInformationFromException):
(Inspector::createScriptCallStackFromException):
* inspector/ScriptCallStackFactory.h:
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::evaluateBreakpointAction):
(Inspector::ScriptDebugServer::handleBreakpointHit):
(Inspector::ScriptDebugServer::handleExceptionInBreakpointCondition):
* inspector/ScriptDebugServer.h:
* interpreter/CallFrame.h:
(JSC::ExecState::clearException):
(JSC::ExecState::exception):
(JSC::ExecState::hadException):
(JSC::ExecState::atomicStringTable):
(JSC::ExecState::propertyNames):
(JSC::ExecState::clearSupplementaryExceptionInfo): Deleted.

* interpreter/Interpreter.cpp:
(JSC::unwindCallFrame):
(JSC::Interpreter::stackTraceAsString):
(JSC::GetCatchHandlerFunctor::GetCatchHandlerFunctor):
(JSC::GetCatchHandlerFunctor::operator()):
(JSC::Interpreter::unwind):
- Added a check for didNotifyInspectorOfThrow() here to prevent duplicate reports
  of the same Exception to the debugger.

(JSC::GetExceptionHandlerFunctor::GetExceptionHandlerFunctor): Deleted.
(JSC::GetExceptionHandlerFunctor::operator()): Deleted.
- Renamed GetExceptionHandlerFunctor to GetCatchHandlerFunctor since the debugger
  is only interested in knowing whether we have Catch handlers.

* interpreter/Interpreter.h:
(JSC::SuspendExceptionScope::SuspendExceptionScope):
(JSC::SuspendExceptionScope::~SuspendExceptionScope):
(JSC::Interpreter::sampler):
(JSC::ClearExceptionScope::ClearExceptionScope): Deleted.
(JSC::ClearExceptionScope::~ClearExceptionScope): Deleted.
- Renamed ClearExceptionScope to SuspendExceptionScope because &quot;clear&quot; implies that
  we're purging the exception.  Instead, we're merely suspending any handling of
  that exception for a period defined by the scope.

* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitExceptionCheck):

* jit/JITExceptions.cpp:
(JSC::genericUnwind):
- Removed the exception argument.  It is always the value in VM::exception() anyway.
  genericUnwind() can just get it from the VM, and save everyone some work.

* jit/JITExceptions.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_catch):
- Add support for the new op_catch operands.

* jit/JITOperations.cpp:
* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
* jsc.cpp:
(functionRun):
(functionLoad):
(runWithScripts):
(runInteractive):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
- Add support for the new op_catch operands.  Also update the code to handle
  VM::m_exception being an Exception pointer, not a JSValue.

* parser/NodeConstructors.h:
(JSC::TryNode::TryNode):
* parser/Nodes.h:
* runtime/CallData.cpp:
(JSC::call):
* runtime/CallData.h:

* runtime/Completion.cpp:
(JSC::evaluate):
* runtime/Completion.h:
(JSC::evaluate):
- Change evaluate() to take a reference to the returned exception value instead
  of a pointer.  In all but 2 or 3 cases, we want the returned exception anyway.
  Might as well simplify the code by requiring the reference.

* runtime/Error.h:
(JSC::throwVMError):
(JSC::throwVMTypeError):

* runtime/Exception.cpp: Added.
(JSC::Exception::create):
(JSC::Exception::destroy):
(JSC::Exception::createStructure):
(JSC::Exception::visitChildren):
(JSC::Exception::Exception):
(JSC::Exception::~Exception):
* runtime/Exception.h: Added.
(JSC::Exception::valueOffset):
(JSC::Exception::cast):
(JSC::Exception::value):
(JSC::Exception::stack):
(JSC::Exception::didNotifyInspectorOfThrow):
(JSC::Exception::setDidNotifyInspectorOfThrow):

* runtime/ExceptionHelpers.cpp:
(JSC::createTerminatedExecutionException):
(JSC::isTerminatedExecutionException):
(JSC::createStackOverflowError):
* runtime/ExceptionHelpers.h:
* runtime/GetterSetter.cpp:
(JSC::callGetter):
* runtime/IteratorOperations.cpp:
(JSC::iteratorClose):
* runtime/JSObject.cpp:
* runtime/JSPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/JSPromiseDeferred.cpp:
(JSC::updateDeferredFromPotentialThenable):
(JSC::abruptRejection):
* runtime/JSPromiseReaction.cpp:
(JSC::ExecutePromiseReactionMicrotask::run):

* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::releaseExecutableMemory):
(JSC::VM::throwException):
(JSC::VM::setStackPointerAtVMEntry):
(JSC::VM::getExceptionInfo): Deleted.
(JSC::VM::setExceptionInfo): Deleted.
(JSC::VM::clearException): Deleted.
(JSC::clearExceptionStack): Deleted.
* runtime/VM.h:
(JSC::VM::targetMachinePCForThrowOffset):
(JSC::VM::clearException):
(JSC::VM::setException):
(JSC::VM::exception):
(JSC::VM::addressOfException):
(JSC::VM::exceptionStack): Deleted.
* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::setEntryScopeDidPopListener):

Source/WebCore:

Update to use the new JSC::Exception object.

Test: inspector/debugger/break-on-exceptions.html

* ForwardingHeaders/runtime/Exception.h: Added.
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsArray):
(WebCore::reportException):
(WebCore::reportCurrentException):
* bindings/js/JSDOMBinding.h:
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSMainThreadExecState.cpp:
(WebCore::JSMainThreadExecState::didLeaveScriptContext):
(WebCore::functionCallHandlerFromAnyThread):
(WebCore::evaluateHandlerFromAnyThread):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::currentState):
(WebCore::JSMainThreadExecState::call):
(WebCore::JSMainThreadExecState::evaluate):
(WebCore::JSMainThreadExecState::runTask):

* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevices::getUserMedia):
- Fixed a bug where the exception was not cleared before entering the VM to
  call JS code.

* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::call):
* bindings/js/ReadableJSStream.cpp:
(WebCore::getPropertyFromObject):
(WebCore::callFunction):
(WebCore::ReadableJSStream::Source::start):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
(WebCore::WorkerScriptController::setException):
(WebCore::WorkerScriptController::scheduleExecutionTermination):
* bindings/js/WorkerScriptController.h:
(WebCore::WorkerScriptController::workerGlobalScopeWrapper):
* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
(WebCore::WorkerScriptDebugServer::reportException):
* bindings/js/WorkerScriptDebugServer.h:
* bindings/objc/WebScriptObject.mm:
(WebCore::createJSWrapper):
(WebCore::addExceptionToConsole):
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject evaluateWebScript:]):
- Changed to call a version of JSMainThreadExecState::evaluate() that provides
  a stub returnedException because evaluateWebScript: doesn't need the exception.

* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::isContentScript):
(WebCore::PageScriptDebugServer::reportException):
* inspector/PageScriptDebugServer.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):

Source/WebKit/mac:

* WebView/WebView.mm:
(+[WebView _reportException:inContext:]):
(WebKitInitializeApplicationCachePathIfNecessary):
- Changed to use the new Exception object.

Source/WebKit/win:

* WebView.cpp:
(WebView::reportException):
- Changed to use the new Exception object.

Source/WebKit2:

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::reportException):
- Changed to use the new Exception object.

LayoutTests:

* TestExpectations:
- Skip the new tests until webkit.org/b/145090 is fixed.

* fast/dom/regress-131530-expected.txt:
- Rebased results because we now have a proper line number.

* http/tests/inspector/inspector-test.js:
(InspectorTestProxy.clearResults):
(InspectorTestProxy.reportUncaughtException):
- Add the feature to sanitize the url reported by reportUncaughtException() since
  we can have tests that do expect uncaught exceptions, and we need the test
  results to be invariant.  Sanitization of the url, in this case means, stripping
  off the preceding path.

* inspector/debugger/break-on-exception-expected.txt: Added.
* inspector/debugger/break-on-exception.html: Added.
* inspector/debugger/break-on-exception-catch-expected.txt: Added.
* inspector/debugger/break-on-exception-catch.html: Added.
* inspector/debugger/break-on-exception-finally-expected.txt: Added.
* inspector/debugger/break-on-exception-finally.html: Added.
* inspector/debugger/break-on-exception-native-expected.txt: Added.
* inspector/debugger/break-on-exception-native.html: Added.

* inspector/debugger/break-on-exception-throw-in-promise-expected.txt: Added.
* inspector/debugger/break-on-exception-throw-in-promise.html: Added.
* inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt: Added.
* inspector/debugger/break-on-exception-throw-in-promise-with-catch.html: Added.
* inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt: Added.
* inspector/debugger/break-on-exception-throw-in-promise-then.html: Added.
* inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt: Added.
* inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html: Added.
* inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt: Added.
* inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html: Added.

* inspector/debugger/break-on-exception-window-onerror-expected.txt: Added.
* inspector/debugger/break-on-exception-window-onerror.html: Added.

* inspector/debugger/break-on-uncaught-exception-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception.html: Added.
* inspector/debugger/break-on-uncaught-exception-catch-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-catch.html: Added.
* inspector/debugger/break-on-uncaught-exception-finally-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-finally.html: Added.
* inspector/debugger/break-on-uncaught-exception-native-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-native.html: Added.

* inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise.html: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html: Added.

* inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt: Added.
* inspector/debugger/break-on-uncaught-exception-window-onerror.html: Added.

* inspector/debugger/resources/break-on-exception-tests.js: Added.
(doThrow):
(testCatch):
(testFinally):
(testThrowingThruNativeCode):
(testThrowingInPromise):
(testThrowingInPromiseWithCatch):
(testThrowingInPromiseThen):
(testThrowingInPromiseThenWithCatch):
(testThrowingInPromiseWithRethrowInCatch):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsfastdomregress131530expectedtxt">trunk/LayoutTests/fast/dom/regress-131530-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorinspectortestjs">trunk/LayoutTests/http/tests/inspector/inspector-test.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSBasecpp">trunk/Source/JavaScriptCore/API/JSBase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSObjectRefcpp">trunk/Source/JavaScriptCore/API/JSObjectRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSScriptRefcpp">trunk/Source/JavaScriptCore/API/JSScriptRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValuemm">trunk/Source/JavaScriptCore/API/JSValue.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValueRefcpp">trunk/Source/JavaScriptCore/API/JSValueRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebindingsScriptFunctionCallcpp">trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebindingsScriptFunctionCallh">trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeUseDefh">trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockh">trunk/Source/JavaScriptCore/bytecode/CodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeHandlerInfoh">trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerh">trunk/Source/JavaScriptCore/debugger/Debugger.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFrameh">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptManagercpp">trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInspectorEnvironmenth">trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllerh">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServerh">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJavaScriptCallFrameh">trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptCallStackFactorycpp">trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptCallStackFactoryh">trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServerh">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFrameh">trunk/Source/JavaScriptCore/interpreter/CallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpreterh">trunk/Source/JavaScriptCore/interpreter/Interpreter.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitAssemblyHelperscpp">trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITExceptionscpp">trunk/Source/JavaScriptCore/jit/JITExceptions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITExceptionsh">trunk/Source/JavaScriptCore/jit/JITExceptions.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodescpp">trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodes32_64cpp">trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitThunkGeneratorscpp">trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp">trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodeConstructorsh">trunk/Source/JavaScriptCore/parser/NodeConstructors.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodesh">trunk/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCallDatacpp">trunk/Source/JavaScriptCore/runtime/CallData.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCallDatah">trunk/Source/JavaScriptCore/runtime/CallData.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCompletioncpp">trunk/Source/JavaScriptCore/runtime/Completion.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCompletionh">trunk/Source/JavaScriptCore/runtime/Completion.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorh">trunk/Source/JavaScriptCore/runtime/Error.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionHelperscpp">trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionHelpersh">trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGetterSettercpp">trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIteratorOperationscpp">trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPromiseConstructorcpp">trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPromiseDeferredcpp">trunk/Source/JavaScriptCore/runtime/JSPromiseDeferred.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPromiseReactioncpp">trunk/Source/JavaScriptCore/runtime/JSPromiseReaction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMEntryScopecpp">trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCallbackDatacpp">trunk/Source/WebCore/bindings/js/JSCallbackData.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomXPathNSResolvercpp">trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSErrorHandlercpp">trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenercpp">trunk/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMainThreadExecStatecpp">trunk/Source/WebCore/bindings/js/JSMainThreadExecState.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMainThreadExecStateh">trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMediaDevicesCustomcpp">trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMutationCallbackcpp">trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsReadableJSStreamcpp">trunk/Source/WebCore/bindings/js/ReadableJSStream.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScheduledActioncpp">trunk/Source/WebCore/bindings/js/ScheduledAction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptControllercpp">trunk/Source/WebCore/bindings/js/ScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllercpp">trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllerh">trunk/Source/WebCore/bindings/js/WorkerScriptController.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptDebugServercpp">trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptDebugServerh">trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcWebScriptObjectmm">trunk/Source/WebCore/bindings/objc/WebScriptObject.mm</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageScriptDebugServercpp">trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageScriptDebugServerh">trunk/Source/WebCore/inspector/PageScriptDebugServer.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptioncatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptioncatchhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionfinallyexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-finally-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionfinallyhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-finally.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionnativeexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-native-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionnativehtml">trunk/LayoutTests/inspector/debugger/break-on-exception-native.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromiseexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromiserethrowincatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromiserethrowincatchhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenwithcatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenwithcatchhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisewithcatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisewithcatchhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisehtml">trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionwindowonerrorexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionwindowonerrorhtml">trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonexceptionhtml">trunk/LayoutTests/inspector/debugger/break-on-exception.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptioncatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptioncatchhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionfinallyexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionfinallyhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionnativeexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionnativehtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromiseexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromiserethrowincatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromiserethrowincatchhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenwithcatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenwithcatchhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisewithcatchexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisewithcatchhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisehtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionwindowonerrorexpectedtxt">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionwindowonerrorhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionhtml">trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception.html</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerresourcesbreakonexceptiontestsjs">trunk/LayoutTests/inspector/debugger/resources/break-on-exception-tests.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptioncpp">trunk/Source/JavaScriptCore/runtime/Exception.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionh">trunk/Source/JavaScriptCore/runtime/Exception.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersruntimeExceptionh">trunk/Source/WebCore/ForwardingHeaders/runtime/Exception.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/LayoutTests/ChangeLog        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2015-06-05  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        finally blocks should not set the exception stack trace when re-throwing the exception.
+        https://bugs.webkit.org/show_bug.cgi?id=145525
+
+        Reviewed by Geoffrey Garen.
+
+        * TestExpectations:
+        - Skip the new tests until webkit.org/b/145090 is fixed.
+
+        * fast/dom/regress-131530-expected.txt:
+        - Rebased results because we now have a proper line number.
+
+        * http/tests/inspector/inspector-test.js:
+        (InspectorTestProxy.clearResults):
+        (InspectorTestProxy.reportUncaughtException):
+        - Add the feature to sanitize the url reported by reportUncaughtException() since
+          we can have tests that do expect uncaught exceptions, and we need the test
+          results to be invariant.  Sanitization of the url, in this case means, stripping
+          off the preceding path.
+
+        * inspector/debugger/break-on-exception-expected.txt: Added.
+        * inspector/debugger/break-on-exception.html: Added.
+        * inspector/debugger/break-on-exception-catch-expected.txt: Added.
+        * inspector/debugger/break-on-exception-catch.html: Added.
+        * inspector/debugger/break-on-exception-finally-expected.txt: Added.
+        * inspector/debugger/break-on-exception-finally.html: Added.
+        * inspector/debugger/break-on-exception-native-expected.txt: Added.
+        * inspector/debugger/break-on-exception-native.html: Added.
+
+        * inspector/debugger/break-on-exception-throw-in-promise-expected.txt: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise.html: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-with-catch.html: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-then.html: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt: Added.
+        * inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html: Added.
+
+        * inspector/debugger/break-on-exception-window-onerror-expected.txt: Added.
+        * inspector/debugger/break-on-exception-window-onerror.html: Added.
+
+        * inspector/debugger/break-on-uncaught-exception-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-catch-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-catch.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-finally-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-finally.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-native-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-native.html: Added.
+
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html: Added.
+
+        * inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt: Added.
+        * inspector/debugger/break-on-uncaught-exception-window-onerror.html: Added.
+
+        * inspector/debugger/resources/break-on-exception-tests.js: Added.
+        (doThrow):
+        (testCatch):
+        (testFinally):
+        (testThrowingThruNativeCode):
+        (testThrowingInPromise):
+        (testThrowingInPromiseWithCatch):
+        (testThrowingInPromiseThen):
+        (testThrowingInPromiseThenWithCatch):
+        (testThrowingInPromiseWithRethrowInCatch):
+
</ins><span class="cx"> 2015-06-05  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Layout tests fullscreen/video-controls-drag.html and media/video-fullscreeen-only-controls.html
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/LayoutTests/TestExpectations        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -525,3 +525,25 @@
</span><span class="cx"> webkit.org/b/145007 js/regress-141098.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/145390 storage/indexeddb/deleteIndex-bug110792.html [ Pass Failure ]
</span><ins>+
+webkit.org/b/145090 inspector/debugger/break-on-exception.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-finally.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-native.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-throw-in-promise.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-throw-in-promise-with-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-throw-in-promise-then.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-exception-window-onerror.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-finally.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-native.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-throw-in-promise.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html [ Skip ]
+webkit.org/b/145090 inspector/debugger/break-on-uncaught-exception-window-onerror.html [ Skip ]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomregress131530expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/regress-131530-expected.txt (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/regress-131530-expected.txt        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/LayoutTests/fast/dom/regress-131530-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> CONSOLE MESSAGE: line 5: Exception to trigger unwinding in MutationObserver
</span><del>-CONSOLE MESSAGE: Pending exception before MutationObservers are called.
</del><ins>+CONSOLE MESSAGE: line 22: Pending exception before MutationObservers are called.
</ins><span class="cx"> Regression test for https://webkit.org/b/131530. This test should not crash.
</span><span class="cx"> 
</span><span class="cx"> Mutate that node
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorinspectortestjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/inspector/inspector-test.js (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/inspector-test.js        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/LayoutTests/http/tests/inspector/inspector-test.js        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -143,8 +143,20 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+InspectorTestProxy.needToSanitizeUncaughtExceptionURLs = false;
+
</ins><span class="cx"> InspectorTestProxy.reportUncaughtException = function(message, url, lineNumber)
</span><span class="cx"> {
</span><ins>+    if (InspectorTestProxy.needToSanitizeUncaughtExceptionURLs) {
+        if (typeof url == &quot;string&quot;) {
+            var lastSlash = url.lastIndexOf(&quot;/&quot;);
+            var lastBackSlash = url.lastIndexOf(&quot;\\&quot;);
+            var lastPathSeparator = Math.max(lastSlash, lastBackSlash);
+            if (lastPathSeparator &gt; 0)
+                url = url.substr(lastPathSeparator + 1);
+        }
+    }
+
</ins><span class="cx">     var result = &quot;Uncaught exception in test page: &quot; + message + &quot; [&quot; + url + &quot;:&quot; + lineNumber + &quot;]&quot;;
</span><span class="cx">     InspectorTestProxy.addResult(result);
</span><span class="cx">     InspectorTestProxy.completeTest();
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptioncatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 12: testCatch
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 16: catch TestError
+CONSOLE MESSAGE: line 18: DONE
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptioncatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testCatch', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionfinallyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-finally-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-finally-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-finally-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 22: testFinally
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 26: finally
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionfinallyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-finally.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-finally.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-finally.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testFinally', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionnativeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-native-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-native-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-native-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 31: testThrowingThruNativeCode
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionnativehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-native.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-native.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-native.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingThruNativeCode', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromiseexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+CONSOLE MESSAGE: line 36: testThrowingInPromise
+CONSOLE MESSAGE: line 38: in promise
+CONSOLE MESSAGE: line 7: throwing TestError
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromiserethrowincatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 80: testThrowingInPromiseWithRethrowInCatch
+CONSOLE MESSAGE: line 82: in promise
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 85: in promise.catch
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+PAUSE #2 AT: promiseCatch:86:16
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromiserethrowincatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-rethrow-in-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseWithRethrowInCatch', 'AllExceptions', 'FinishOnResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 55: testThrowingInPromiseThen
+CONSOLE MESSAGE: line 57: in promise
+CONSOLE MESSAGE: line 60: in promise.then
+CONSOLE MESSAGE: line 7: throwing TestError
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenwithcatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+CONSOLE MESSAGE: line 66: testThrowingInPromiseThenWithCatch
+CONSOLE MESSAGE: line 68: in promise
+CONSOLE MESSAGE: line 71: in promise.then
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 74: in promise.catch
+CONSOLE MESSAGE: line 75: DONE
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenwithcatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then-with-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseThenWithCatch', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisethenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-then.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseThen', 'AllExceptions', 'FinishOnResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisewithcatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 44: testThrowingInPromiseWithCatch
+CONSOLE MESSAGE: line 46: in promise
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 49: in promise.catch
+CONSOLE MESSAGE: line 50: DONE
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisewithcatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise-with-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseWithCatch', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionthrowinpromisehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-throw-in-promise.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromise', 'AllExceptions', 'FinishOnResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionwindowonerrorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 8: window.onerror: TestError
+CONSOLE MESSAGE: line 9: DONE
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on all exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionwindowonerrorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception-window-onerror.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.onerror = function(e) {
+    console.log(&quot;window.onerror: &quot; + e);
+    console.log(&quot;DONE&quot;);
+}
+
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('doThrow', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonexceptionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-exception.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-exception.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-exception.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('doThrow', 'AllExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on all exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptioncatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+CONSOLE MESSAGE: line 12: testCatch
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 16: catch TestError
+CONSOLE MESSAGE: line 18: DONE
+Checking pause locations when pausing on uncaught exceptions.
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptioncatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testCatch', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionfinallyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 22: testFinally
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 26: finally
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionfinallyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-finally.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testFinally', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionnativeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 31: testThrowingThruNativeCode
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+Uncaught exception in test page: TestError [break-on-exception-tests.js:8]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionnativehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-native.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingThruNativeCode', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromiseexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+CONSOLE MESSAGE: line 36: testThrowingInPromise
+CONSOLE MESSAGE: line 38: in promise
+CONSOLE MESSAGE: line 7: throwing TestError
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromiserethrowincatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 80: testThrowingInPromiseWithRethrowInCatch
+CONSOLE MESSAGE: line 82: in promise
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 85: in promise.catch
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+PAUSE #2 AT: promiseCatch:86:16
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromiserethrowincatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-rethrow-in-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseWithRethrowInCatch', 'UncaughtExceptions', 'FinishOnResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 55: testThrowingInPromiseThen
+CONSOLE MESSAGE: line 57: in promise
+CONSOLE MESSAGE: line 60: in promise.then
+CONSOLE MESSAGE: line 7: throwing TestError
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenwithcatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+CONSOLE MESSAGE: line 66: testThrowingInPromiseThenWithCatch
+CONSOLE MESSAGE: line 68: in promise
+CONSOLE MESSAGE: line 71: in promise.then
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 74: in promise.catch
+CONSOLE MESSAGE: line 75: DONE
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenwithcatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then-with-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseThenWithCatch', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisethenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-then.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseThen', 'UncaughtExceptions', 'FinishOnResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisewithcatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 44: testThrowingInPromiseWithCatch
+CONSOLE MESSAGE: line 46: in promise
+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 49: in promise.catch
+CONSOLE MESSAGE: line 50: DONE
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisewithcatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise-with-catch.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromiseWithCatch', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionthrowinpromisehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-throw-in-promise.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('testThrowingInPromise', 'UncaughtExceptions', 'FinishOnResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionwindowonerrorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror-expected.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+CONSOLE MESSAGE: line 7: throwing TestError
+CONSOLE MESSAGE: line 8: window.onerror: TestError
+CONSOLE MESSAGE: line 9: DONE
+CONSOLE MESSAGE: line 8: TestError
+Checking pause locations when pausing on uncaught exceptions.
+
+PAUSE #1 AT: doThrow:8:22
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionwindowonerrorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception-window-onerror.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.onerror = function(e) {
+    console.log(&quot;window.onerror: &quot; + e);
+    console.log(&quot;DONE&quot;);
+}
+
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('doThrow', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakonuncaughtexceptionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception.html (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/break-on-uncaught-exception.html        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;./resources/break-on-exception-tests.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test() {
+    function doExceptionTest(testName, exceptionBreakType, resumeAction)
+    {
+        var pauses = 0;
+        var index = 0;
+
+        function runTestCase(test) {
+            InspectorTest.evaluateInPage(&quot;setTimeout(&quot; + test + &quot;, 50)&quot;);
+        }
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
+            var scriptObject = event.data.script;
+            if (!/break-on-exception-tests\.js$/.test(scriptObject.url))
+                return;
+
+            if (exceptionBreakType == 'AllExceptions')
+                WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+            else
+                WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
+
+            runTestCase(testName);
+        });
+
+        WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, function(event) {
+            var callFrame = WebInspector.debuggerManager.activeCallFrame;
+            if (callFrame) {
+                // Pausing.
+                InspectorTest.assert(WebInspector.debuggerManager.pauseReason == &quot;exception&quot;);
+
+                var funcName = callFrame.functionName || &quot;&lt;anonymous&gt;&quot;;
+                var location = callFrame.sourceCodeLocation;
+                var line = location.lineNumber + 1;
+                var column = location.columnNumber + 1;
+
+                InspectorTest.log(&quot;PAUSE #&quot; + (++pauses) + &quot; AT: &quot; + funcName + &quot;:&quot; + line + &quot;:&quot; + column);
+                WebInspector.debuggerManager.resume();
+
+            } else {
+                // Resuming.
+                if (resumeAction == 'FinishOnResume')
+                    InspectorTest.completeTest();
+            }
+        });
+
+        // This is a signal mechanism for the web process to tell us that the test is done.
+        // The web process fires the signal by doing console.log(&quot;DONE&quot;).
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
+            var message = event.data.message;
+            if (!message.parameters || message.parameters.length !== 1)
+                return;
+            if (message.parameters[0].type !== &quot;string&quot; || message.parameters[0].description !== &quot;DONE&quot;)
+                return;
+            InspectorTest.completeTest();
+        });
+
+        InspectorTest.reloadPage();
+    }
+
+    doExceptionTest('doThrow', 'UncaughtExceptions', 'IgnoreResume');
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Checking pause locations when pausing on uncaught exceptions.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerresourcesbreakonexceptiontestsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/resources/break-on-exception-tests.js (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/resources/break-on-exception-tests.js                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/resources/break-on-exception-tests.js        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+InspectorTestProxy.needToSanitizeUncaughtExceptionURLs = true;
+
+var arr = [ 1, 2, 3 ];
+var mapData = [[ &quot;a&quot;, arr ]];
+
+function doThrow() {
+    console.log(&quot;throwing TestError&quot;);
+    throw &quot;TestError&quot;;
+}
+
+function testCatch() {
+    console.log(&quot;testCatch&quot;);
+    try {
+        doThrow();
+    } catch (e) {
+        console.log(&quot;catch &quot; + e);
+    }
+    console.log(&quot;DONE&quot;);
+}
+
+function testFinally() {
+    console.log(&quot;testFinally&quot;);
+    try {
+        doThrow();
+    } finally {
+        console.log(&quot;finally&quot;);
+    }
+}
+
+function testThrowingThruNativeCode() {
+    console.log(&quot;testThrowingThruNativeCode&quot;);
+    (new Map(mapData)).forEach(doThrow);
+}
+
+function testThrowingInPromise() {
+    console.log(&quot;testThrowingInPromise&quot;);
+    new Promise(function promise(resolve, reject) {
+        console.log(&quot;in promise&quot;);
+        doThrow();
+    });
+}
+
+function testThrowingInPromiseWithCatch() {
+    console.log(&quot;testThrowingInPromiseWithCatch&quot;);
+    new Promise(function promise(resolve, reject) {
+        console.log(&quot;in promise&quot;);
+        doThrow();
+    }).catch(function promiseCatch(e) {
+        console.log(&quot;in promise.catch&quot;);
+        console.log(&quot;DONE&quot;);
+    });
+}
+
+function testThrowingInPromiseThen() {
+    console.log(&quot;testThrowingInPromiseThen&quot;);
+    new Promise(function promise(resolve, reject) {
+        console.log(&quot;in promise&quot;);
+        resolve();
+    }).then(function promiseThen(x) {
+        console.log(&quot;in promise.then&quot;);
+        doThrow();
+    });
+}
+
+function testThrowingInPromiseThenWithCatch() {
+    console.log(&quot;testThrowingInPromiseThenWithCatch&quot;);
+    new Promise(function promise(resolve, reject) {
+        console.log(&quot;in promise&quot;);
+        resolve();
+    }).then(function promiseThen(x) {
+        console.log(&quot;in promise.then&quot;);
+        doThrow();
+    }).catch(function promiseCatch(e) {
+        console.log(&quot;in promise.catch&quot;);
+        console.log(&quot;DONE&quot;);
+    });
+}
+
+function testThrowingInPromiseWithRethrowInCatch() {
+    console.log(&quot;testThrowingInPromiseWithRethrowInCatch&quot;);
+    new Promise(function promise(resolve, reject) {
+        console.log(&quot;in promise&quot;);
+        doThrow();
+    }).catch(function promiseCatch(e) {
+        console.log(&quot;in promise.catch&quot;);
+        throw e;
+    });
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSBase.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSBase.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/API/JSBase.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;APICast.h&quot;
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><span class="cx"> #include &quot;Completion.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;GCActivityCallback.h&quot;
</span><span class="cx"> #include &quot;InitializeThreading.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="lines">@@ -63,12 +64,12 @@
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;vmEntryGlobalObject();
</span><span class="cx">     SourceCode source = makeSource(script-&gt;string(), sourceURL ? sourceURL-&gt;string() : String(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
</span><span class="cx"> 
</span><del>-    JSValue evaluationException;
-    JSValue returnValue = evaluate(globalObject-&gt;globalExec(), source, jsThisObject, &amp;evaluationException);
</del><ins>+    Exception* evaluationException;
+    JSValue returnValue = evaluate(globalObject-&gt;globalExec(), source, jsThisObject, evaluationException);
</ins><span class="cx"> 
</span><span class="cx">     if (evaluationException) {
</span><span class="cx">         if (exception)
</span><del>-            *exception = toRef(exec, evaluationException);
</del><ins>+            *exception = toRef(exec, evaluationException-&gt;value());
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">         // FIXME: If we have a debugger attached we could learn about ParseError exceptions through
</span><span class="cx">         // ScriptDebugServer::sourceParsed and this path could produce a duplicate warning. The
</span><span class="lines">@@ -107,7 +108,8 @@
</span><span class="cx">         if (exception)
</span><span class="cx">             *exception = toRef(exec, syntaxException);
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><del>-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, syntaxException);
</del><ins>+        Exception* exception = Exception::create(exec-&gt;vm(), syntaxException);
+        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exception);
</ins><span class="cx"> #endif
</span><span class="cx">         return false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSObjectRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSObjectRef.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSObjectRef.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/API/JSObjectRef.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;CopiedSpaceInlines.h&quot;
</span><span class="cx"> #include &quot;DateConstructor.h&quot;
</span><span class="cx"> #include &quot;ErrorConstructor.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;FunctionConstructor.h&quot;
</span><span class="cx"> #include &quot;Identifier.h&quot;
</span><span class="cx"> #include &quot;InitializeThreading.h&quot;
</span><span class="lines">@@ -61,6 +62,26 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><ins>+enum class ExceptionStatus {
+    DidThrow,
+    DidNotThrow
+};
+
+static ExceptionStatus handleExceptionIfNeeded(ExecState* exec, JSValueRef* returnedExceptionRef)
+{
+    if (exec-&gt;hadException()) {
+        Exception* exception = exec-&gt;exception();
+        if (returnedExceptionRef)
+            *returnedExceptionRef = toRef(exec, exception-&gt;value());
+        exec-&gt;clearException();
+#if ENABLE(REMOTE_INSPECTOR)
+        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exception);
+#endif
+        return ExceptionStatus::DidThrow;
+    }
+    return ExceptionStatus::DidNotThrow;
+}
+
</ins><span class="cx"> JSClassRef JSClassCreate(const JSClassDefinition* definition)
</span><span class="cx"> {
</span><span class="cx">     initializeThreading();
</span><span class="lines">@@ -148,16 +169,8 @@
</span><span class="cx">     args.append(jsString(exec, body-&gt;string()));
</span><span class="cx"> 
</span><span class="cx">     JSObject* result = constructFunction(exec, exec-&gt;lexicalGlobalObject(), args, nameID, sourceURL ? sourceURL-&gt;string() : String(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx">     return toRef(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -180,16 +193,8 @@
</span><span class="cx">     } else
</span><span class="cx">         result = constructEmptyArray(exec, 0);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return toRef(result);
</span><span class="cx"> }
</span><span class="lines">@@ -208,16 +213,8 @@
</span><span class="cx">         argList.append(toJS(exec, arguments[i]));
</span><span class="cx"> 
</span><span class="cx">     JSObject* result = constructDate(exec, exec-&gt;lexicalGlobalObject(), argList);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return toRef(result);
</span><span class="cx"> }
</span><span class="lines">@@ -235,16 +232,8 @@
</span><span class="cx">     Structure* errorStructure = exec-&gt;lexicalGlobalObject()-&gt;errorStructure();
</span><span class="cx">     JSObject* result = ErrorInstance::create(exec, errorStructure, message);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return toRef(result);
</span><span class="cx"> }
</span><span class="lines">@@ -263,16 +252,8 @@
</span><span class="cx">         argList.append(toJS(exec, arguments[i]));
</span><span class="cx"> 
</span><span class="cx">     JSObject* result = constructRegExp(exec, exec-&gt;lexicalGlobalObject(),  argList);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx">     
</span><span class="cx">     return toRef(result);
</span><span class="cx"> }
</span><span class="lines">@@ -339,15 +320,7 @@
</span><span class="cx">     JSObject* jsObject = toJS(object);
</span><span class="cx"> 
</span><span class="cx">     JSValue jsValue = jsObject-&gt;get(exec, propertyName-&gt;identifier(&amp;exec-&gt;vm()));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
</ins><span class="cx">     return toRef(exec, jsValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -372,15 +345,7 @@
</span><span class="cx">         jsObject-&gt;methodTable()-&gt;put(jsObject, exec, name, jsValue, slot);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception)
</span><span class="lines">@@ -395,15 +360,7 @@
</span><span class="cx">     JSObject* jsObject = toJS(object);
</span><span class="cx"> 
</span><span class="cx">     JSValue jsValue = jsObject-&gt;get(exec, propertyIndex);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
</ins><span class="cx">     return toRef(exec, jsValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -421,15 +378,7 @@
</span><span class="cx">     JSValue jsValue = toJS(exec, value);
</span><span class="cx">     
</span><span class="cx">     jsObject-&gt;methodTable()-&gt;putByIndex(jsObject, exec, propertyIndex, jsValue, false);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
</span><span class="lines">@@ -444,15 +393,7 @@
</span><span class="cx">     JSObject* jsObject = toJS(object);
</span><span class="cx"> 
</span><span class="cx">     bool result = jsObject-&gt;methodTable()-&gt;deleteProperty(jsObject, exec, propertyName-&gt;identifier(&amp;exec-&gt;vm()));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -616,16 +557,8 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -657,16 +590,8 @@
</span><span class="cx">     for (size_t i = 0; i &lt; argumentCount; i++)
</span><span class="cx">         argList.append(toJS(exec, arguments[i]));
</span><span class="cx">     JSObjectRef result = toRef(construct(exec, jsObject, constructType, constructData, argList));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         result = 0;
</span><del>-    }
</del><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSScriptRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSScriptRef.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSScriptRef.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/API/JSScriptRef.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APICast.h&quot;
</span><span class="cx"> #include &quot;Completion.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSBasePrivate.h&quot;
</span><span class="cx"> #include &quot;VM.h&quot;
</span><span class="cx"> #include &quot;JSScriptRefPrivate.h&quot;
</span><span class="lines">@@ -142,12 +143,12 @@
</span><span class="cx">         RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><del>-    JSValue internalException;
</del><ins>+    Exception* internalException;
</ins><span class="cx">     JSValue thisValue = thisValueRef ? toJS(exec, thisValueRef) : jsUndefined();
</span><del>-    JSValue result = evaluate(exec, SourceCode(script), thisValue, &amp;internalException);
</del><ins>+    JSValue result = evaluate(exec, SourceCode(script), thisValue, internalException);
</ins><span class="cx">     if (internalException) {
</span><span class="cx">         if (exception)
</span><del>-            *exception = toRef(exec, internalException);
</del><ins>+            *exception = toRef(exec, internalException-&gt;value());
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx">     ASSERT(result);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValuemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValue.mm (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValue.mm        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/API/JSValue.mm        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #import &quot;APICast.h&quot;
</span><span class="cx"> #import &quot;DateInstance.h&quot;
</span><span class="cx"> #import &quot;Error.h&quot;
</span><ins>+#import &quot;Exception.h&quot;
</ins><span class="cx"> #import &quot;JavaScriptCore.h&quot;
</span><span class="cx"> #import &quot;JSContextInternal.h&quot;
</span><span class="cx"> #import &quot;JSVirtualMachineInternal.h&quot;
</span><span class="lines">@@ -645,9 +646,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><del>-static void reportExceptionToInspector(JSGlobalContextRef context, JSC::JSValue exception)
</del><ins>+static void reportExceptionToInspector(JSGlobalContextRef context, JSC::JSValue exceptionValue)
</ins><span class="cx"> {
</span><span class="cx">     JSC::ExecState* exec = toJS(context);
</span><ins>+    JSC::Exception* exception = JSC::Exception::create(exec-&gt;vm(), exceptionValue);
</ins><span class="cx">     exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exception);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValueRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValueRef.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValueRef.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/API/JSValueRef.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APICast.h&quot;
</span><span class="cx"> #include &quot;DateInstance.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSAPIWrapperObject.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="lines">@@ -52,6 +53,26 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><ins>+enum class ExceptionStatus {
+    DidThrow,
+    DidNotThrow
+};
+
+static ExceptionStatus handleExceptionIfNeeded(ExecState* exec, JSValueRef* returnedExceptionRef)
+{
+    if (exec-&gt;hadException()) {
+        Exception* exception = exec-&gt;exception();
+        if (returnedExceptionRef)
+            *returnedExceptionRef = toRef(exec, exception-&gt;value());
+        exec-&gt;clearException();
+#if ENABLE(REMOTE_INSPECTOR)
+        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exception);
+#endif
+        return ExceptionStatus::DidThrow;
+    }
+    return ExceptionStatus::DidNotThrow;
+}
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> static bool evernoteHackNeeded()
</span><span class="cx"> {
</span><span class="lines">@@ -224,15 +245,8 @@
</span><span class="cx">     JSValue jsB = toJS(exec, b);
</span><span class="cx"> 
</span><span class="cx">     bool result = JSValue::equal(exec, jsA, jsB); // false if an exception is thrown
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
+    
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -266,15 +280,7 @@
</span><span class="cx">     if (!jsConstructor-&gt;structure()-&gt;typeInfo().implementsHasInstance())
</span><span class="cx">         return false;
</span><span class="cx">     bool result = jsConstructor-&gt;hasInstance(exec, jsValue); // false if an exception is thrown
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
-    }
</del><ins>+    handleExceptionIfNeeded(exec, exception);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -368,16 +374,8 @@
</span><span class="cx">     String result = JSONStringify(exec, value, indent);
</span><span class="cx">     if (exception)
</span><span class="cx">         *exception = 0;
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         return 0;
</span><del>-    }
</del><span class="cx">     return OpaqueJSString::create(result).leakRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -406,16 +404,8 @@
</span><span class="cx">     JSValue jsValue = toJS(exec, value);
</span><span class="cx"> 
</span><span class="cx">     double number = jsValue.toNumber(exec);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         number = PNaN;
</span><del>-    }
</del><span class="cx">     return number;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -431,16 +421,8 @@
</span><span class="cx">     JSValue jsValue = toJS(exec, value);
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;OpaqueJSString&gt; stringRef(OpaqueJSString::create(jsValue.toString(exec)-&gt;value(exec)));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         stringRef.clear();
</span><del>-    }
</del><span class="cx">     return stringRef.release().leakRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -456,16 +438,8 @@
</span><span class="cx">     JSValue jsValue = toJS(exec, value);
</span><span class="cx">     
</span><span class="cx">     JSObjectRef objectRef = toRef(jsValue.toObject(exec));
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exceptionValue = exec-&gt;exception();
-        if (exception)
-            *exception = toRef(exec, exceptionValue);
-        exec-&gt;clearException();
-#if ENABLE(REMOTE_INSPECTOR)
-        exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><ins>+    if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
</ins><span class="cx">         objectRef = 0;
</span><del>-    }
</del><span class="cx">     return objectRef;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -454,6 +454,7 @@
</span><span class="cx">     runtime/ErrorHandlingScope.cpp
</span><span class="cx">     runtime/ErrorInstance.cpp
</span><span class="cx">     runtime/ErrorPrototype.cpp
</span><ins>+    runtime/Exception.cpp
</ins><span class="cx">     runtime/ExceptionFuzz.cpp
</span><span class="cx">     runtime/ExceptionHelpers.cpp
</span><span class="cx">     runtime/Executable.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,3 +1,331 @@
</span><ins>+2015-06-05  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        finally blocks should not set the exception stack trace when re-throwing the exception.
+        https://bugs.webkit.org/show_bug.cgi?id=145525
+
+        Reviewed by Geoffrey Garen.
+
+        How exceptions presently work:
+        =============================
+        1. op_throw can throw any JSValue.
+        2. the VM tries to capture the stack at the throw point and propagate that as needed.
+        3. finally blocks are implemented using op_catch to catch the thrown value, and throws it again using op_throw.
+
+        What's wrong with how it presently works:
+        ========================================
+        1. finally's makes for bad exception throw line numbers in the Inspector console.
+
+           The op_throw in finally will throw the value anew i.e. it captures a stack from the re-throw point.
+           As a result, the Inspector sees the finally block as the throw point.  The original stack is lost.
+
+        2. finally's breaks the Inspector's &quot;Breaks on Uncaught Exception&quot;
+
+           This is because finally blocks are indistinguishable from catch blocks.  As a result, a try-finally,
+           which should break in the Inspector on the throw, does not because the Inspector thought the
+           exception was &quot;caught&quot;.
+
+        3. finally's yields confusing break points when the Inspector &quot;Breaks on All Exceptions&quot;
+
+           a. In a try-finally scenario, the Inspector breaks 2 times: 1 at the throw, 1 at the finally.
+           b. In a for-of loop (which has synthesized finallys), the Inspector will do another break.
+              Similarly for other cases of JS code which synthesize finallys.
+           c. At VM re-entry boundaries (e.g. js throws &amp; returns to native code, which returns to js),
+              the Inspector will do another break if there's an uncaught exception.
+
+        How this patch fixes the issues:
+        ===============================
+        1. We introduce an Exception object that wraps the thrown value and the exception stack.
+
+           When throwing an exception, the VM will check if the thrown value is an Exception
+           object or not.  If it is not an Exception object, then we must be throwing a new
+           exception.  The VM will create an Exception object to wrap the thrown value and
+           capture the current stack for it.
+
+           If the thrown value is already an Exception object, then the requested throw operation
+           must be a re-throw.  The VM will not capture a new stack for it.
+
+        2. op_catch will now populate 2 locals: 1 for the Exception, 1 for the thrown JSValue.
+
+           The VM is aware of the Exception object and uses it for rethrows in finally blocks.
+           JS source code is never aware of the Exception object.
+
+           JS code is aware of the thrown value.  If it throws the caught thrown value, that
+           constitutes a new throw, and a new Exception object will be created for it.
+
+        3. The VM no longer tracks the thrown JSValue and the exception stack.  It will only
+           track a m_exception field which is an Exception*.
+
+        4. The BytecodeGenerator has already been updated in a prior patch to distinguish
+           between Catch, Finally, and SynthesizedFinally blocks.  The interpreter runtime will
+           now report to the debugger whether we have a Catch handler, not just any handlers.
+
+           The debugger will use this detail to determine whether to break or not.  &quot;Break on
+           uncaught exceptions&quot; will only break if no Catch handler was found.
+
+           This solves the issue of the debugger breaking at finally blocks, and for-of statements.
+
+        5. The Exception object will also have a flag to indicate whether the debugger has been
+           notified of the Exception being thrown.  Once the Interpreter notifies the debugger
+           of the Exception object, it will mark this flag and not repeat the notify the debugger
+           again of the same Exception.
+
+           This solves the issue of the debugger breaking at VM re-entry points due to uncaught
+           exceptions.
+
+        6. The life-cycle of the captured exception stack trace will now follow the life-cycle
+           of the Exception object.
+
+        Other changes:
+        7. Change all clients of the VM::exception() to expect an Exception* instead of JSValue.
+
+        8. Fixed a few bugs where thrown exceptions are not cleared before exiting the VM.
+
+        9. Also renamed some variables and classes to better describe what they are.
+
+        * API/JSBase.cpp:
+        (JSEvaluateScript):
+        (JSCheckScriptSyntax):
+
+        * API/JSObjectRef.cpp:
+        (handleExceptionIfNeeded):
+        - The functions below all do the same exception check.  Added this helper
+          to simplify the code.
+        (JSClassCreate):
+        (JSObjectMakeFunction):
+        (JSObjectMakeArray):
+        (JSObjectMakeDate):
+        (JSObjectMakeError):
+        (JSObjectMakeRegExp):
+        (JSObjectGetProperty):
+        (JSObjectSetProperty):
+        (JSObjectGetPropertyAtIndex):
+        (JSObjectSetPropertyAtIndex):
+        (JSObjectDeleteProperty):
+        (JSObjectCallAsFunction):
+        (JSObjectCallAsConstructor):
+
+        * API/JSScriptRef.cpp:
+        * API/JSValue.mm:
+        (JSContainerConvertor::take):
+        (reportExceptionToInspector):
+
+        * API/JSValueRef.cpp:
+        (handleExceptionIfNeeded):
+        - The functions below all do the same exception check.  Added this helper
+          to simplify the code.
+        (evernoteHackNeeded):
+        (JSValueIsEqual):
+        (JSValueIsInstanceOfConstructor):
+        (JSValueCreateJSONString):
+        (JSValueToNumber):
+        (JSValueToStringCopy):
+        (JSValueToObject):
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        - Added new files Exception.h and Exception.cpp.
+
+        * bindings/ScriptFunctionCall.cpp:
+        (Deprecated::ScriptFunctionCall::call):
+        * bindings/ScriptFunctionCall.h:
+
+        * bytecode/BytecodeList.json:
+        - op_catch now had 2 operands: the exception register, and the thrown value register.
+
+        * bytecode/BytecodeUseDef.h:
+        (JSC::computeDefsForBytecodeOffset):
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dumpBytecode):
+        (JSC::CodeBlock::handlerForBytecodeOffset):
+        * bytecode/CodeBlock.h:
+        - handlerForBytecodeOffset() now can look for just Catch handlers only.
+
+        * bytecode/HandlerInfo.h:
+        - Cleaned up some white space I accidentally added in a previous patch.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::pushTry):
+        (JSC::BytecodeGenerator::popTryAndEmitCatch):
+        (JSC::BytecodeGenerator::emitThrowReferenceError):
+        (JSC::BytecodeGenerator::emitEnumeration):
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::BytecodeGenerator::emitThrow):
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::TryNode::emitBytecode):
+        - Adding support for op_catch's 2 operands.
+
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::hasBreakpoint):
+        (JSC::Debugger::pauseIfNeeded):
+        (JSC::Debugger::exception):
+        * debugger/Debugger.h:
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::thisValue):
+        (JSC::DebuggerCallFrame::evaluate):
+        * debugger/DebuggerCallFrame.h:
+        (JSC::DebuggerCallFrame::isValid):
+        * inspector/InjectedScriptManager.cpp:
+        (Inspector::InjectedScriptManager::createInjectedScript):
+        * inspector/InspectorEnvironment.h:
+        * inspector/JSGlobalObjectInspectorController.cpp:
+        (Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
+        (Inspector::JSGlobalObjectInspectorController::reportAPIException):
+        * inspector/JSGlobalObjectInspectorController.h:
+        * inspector/JSGlobalObjectScriptDebugServer.h:
+        * inspector/JSJavaScriptCallFrame.cpp:
+        (Inspector::JSJavaScriptCallFrame::evaluate):
+        * inspector/JavaScriptCallFrame.h:
+        (Inspector::JavaScriptCallFrame::vmEntryGlobalObject):
+        (Inspector::JavaScriptCallFrame::thisValue):
+        (Inspector::JavaScriptCallFrame::evaluate):
+        * inspector/ScriptCallStackFactory.cpp:
+        (Inspector::extractSourceInformationFromException):
+        (Inspector::createScriptCallStackFromException):
+        * inspector/ScriptCallStackFactory.h:
+        * inspector/ScriptDebugServer.cpp:
+        (Inspector::ScriptDebugServer::evaluateBreakpointAction):
+        (Inspector::ScriptDebugServer::handleBreakpointHit):
+        (Inspector::ScriptDebugServer::handleExceptionInBreakpointCondition):
+        * inspector/ScriptDebugServer.h:
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::clearException):
+        (JSC::ExecState::exception):
+        (JSC::ExecState::hadException):
+        (JSC::ExecState::atomicStringTable):
+        (JSC::ExecState::propertyNames):
+        (JSC::ExecState::clearSupplementaryExceptionInfo): Deleted.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::unwindCallFrame):
+        (JSC::Interpreter::stackTraceAsString):
+        (JSC::GetCatchHandlerFunctor::GetCatchHandlerFunctor):
+        (JSC::GetCatchHandlerFunctor::operator()):
+        (JSC::Interpreter::unwind):
+        - Added a check for didNotifyInspectorOfThrow() here to prevent duplicate reports
+          of the same Exception to the debugger.
+
+        (JSC::GetExceptionHandlerFunctor::GetExceptionHandlerFunctor): Deleted.
+        (JSC::GetExceptionHandlerFunctor::operator()): Deleted.
+        - Renamed GetExceptionHandlerFunctor to GetCatchHandlerFunctor since the debugger
+          is only interested in knowing whether we have Catch handlers.
+
+        * interpreter/Interpreter.h:
+        (JSC::SuspendExceptionScope::SuspendExceptionScope):
+        (JSC::SuspendExceptionScope::~SuspendExceptionScope):
+        (JSC::Interpreter::sampler):
+        (JSC::ClearExceptionScope::ClearExceptionScope): Deleted.
+        (JSC::ClearExceptionScope::~ClearExceptionScope): Deleted.
+        - Renamed ClearExceptionScope to SuspendExceptionScope because &quot;clear&quot; implies that
+          we're purging the exception.  Instead, we're merely suspending any handling of
+          that exception for a period defined by the scope.
+
+        * jit/AssemblyHelpers.cpp:
+        (JSC::AssemblyHelpers::emitExceptionCheck):
+
+        * jit/JITExceptions.cpp:
+        (JSC::genericUnwind):
+        - Removed the exception argument.  It is always the value in VM::exception() anyway.
+          genericUnwind() can just get it from the VM, and save everyone some work.
+
+        * jit/JITExceptions.h:
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_catch):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::privateCompileCTINativeCall):
+        (JSC::JIT::emit_op_catch):
+        - Add support for the new op_catch operands.
+
+        * jit/JITOperations.cpp:
+        * jit/ThunkGenerators.cpp:
+        (JSC::nativeForGenerator):
+        * jsc.cpp:
+        (functionRun):
+        (functionLoad):
+        (runWithScripts):
+        (runInteractive):
+        * llint/LLIntOffsetsExtractor.cpp:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        - Add support for the new op_catch operands.  Also update the code to handle
+          VM::m_exception being an Exception pointer, not a JSValue.
+
+        * parser/NodeConstructors.h:
+        (JSC::TryNode::TryNode):
+        * parser/Nodes.h:
+        * runtime/CallData.cpp:
+        (JSC::call):
+        * runtime/CallData.h:
+
+        * runtime/Completion.cpp:
+        (JSC::evaluate):
+        * runtime/Completion.h:
+        (JSC::evaluate):
+        - Change evaluate() to take a reference to the returned exception value instead
+          of a pointer.  In all but 2 or 3 cases, we want the returned exception anyway.
+          Might as well simplify the code by requiring the reference.
+
+        * runtime/Error.h:
+        (JSC::throwVMError):
+        (JSC::throwVMTypeError):
+
+        * runtime/Exception.cpp: Added.
+        (JSC::Exception::create):
+        (JSC::Exception::destroy):
+        (JSC::Exception::createStructure):
+        (JSC::Exception::visitChildren):
+        (JSC::Exception::Exception):
+        (JSC::Exception::~Exception):
+        * runtime/Exception.h: Added.
+        (JSC::Exception::valueOffset):
+        (JSC::Exception::cast):
+        (JSC::Exception::value):
+        (JSC::Exception::stack):
+        (JSC::Exception::didNotifyInspectorOfThrow):
+        (JSC::Exception::setDidNotifyInspectorOfThrow):
+
+        * runtime/ExceptionHelpers.cpp:
+        (JSC::createTerminatedExecutionException):
+        (JSC::isTerminatedExecutionException):
+        (JSC::createStackOverflowError):
+        * runtime/ExceptionHelpers.h:
+        * runtime/GetterSetter.cpp:
+        (JSC::callGetter):
+        * runtime/IteratorOperations.cpp:
+        (JSC::iteratorClose):
+        * runtime/JSObject.cpp:
+        * runtime/JSPromiseConstructor.cpp:
+        (JSC::constructPromise):
+        * runtime/JSPromiseDeferred.cpp:
+        (JSC::updateDeferredFromPotentialThenable):
+        (JSC::abruptRejection):
+        * runtime/JSPromiseReaction.cpp:
+        (JSC::ExecutePromiseReactionMicrotask::run):
+
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        (JSC::VM::releaseExecutableMemory):
+        (JSC::VM::throwException):
+        (JSC::VM::setStackPointerAtVMEntry):
+        (JSC::VM::getExceptionInfo): Deleted.
+        (JSC::VM::setExceptionInfo): Deleted.
+        (JSC::VM::clearException): Deleted.
+        (JSC::clearExceptionStack): Deleted.
+        * runtime/VM.h:
+        (JSC::VM::targetMachinePCForThrowOffset):
+        (JSC::VM::clearException):
+        (JSC::VM::setException):
+        (JSC::VM::exception):
+        (JSC::VM::addressOfException):
+        (JSC::VM::exceptionStack): Deleted.
+        * runtime/VMEntryScope.cpp:
+        (JSC::VMEntryScope::VMEntryScope):
+        (JSC::VMEntryScope::setEntryScopeDidPopListener):
+
</ins><span class="cx"> 2015-06-04  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] Always track out-of-bounds array access explicitly instead of relying on the slow case
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -712,6 +712,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\ErrorHandlingScope.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\ErrorInstance.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\ErrorPrototype.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\Exception.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\ExceptionFuzz.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\ExceptionHelpers.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\Executable.cpp&quot; /&gt;
</span><span class="lines">@@ -1503,6 +1504,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\ErrorHandlingScope.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\ErrorInstance.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\ErrorPrototype.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\Exception.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\ExceptionFuzz.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\ExceptionHelpers.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\Executable.h&quot; /&gt;
</span><span class="lines">@@ -1827,4 +1829,4 @@
</span><span class="cx">   &lt;ImportGroup Label=&quot;ExtensionTargets&quot;&gt;
</span><span class="cx">     &lt;Import Project=&quot;$(VCTargetsPath)\BuildCustomizations\masm.targets&quot; /&gt;
</span><span class="cx">   &lt;/ImportGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1698,6 +1698,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGValueStrength.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dfg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\Exception.cpp&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\ExceptionFuzz.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -4190,6 +4193,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGValueStrength.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dfg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\Exception.h&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\ExceptionFuzz.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -4485,4 +4491,4 @@
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/MASM&gt;
</span><span class="cx">   &lt;/ItemGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1660,6 +1660,8 @@
</span><span class="cx">                 E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE0D4A061AB8DD0A002F54BF /* ExecutionTimeLimitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE0D4A041AB8DD0A002F54BF /* ExecutionTimeLimitTest.cpp */; };
</span><span class="cx">                 FE0D4A091ABA2437002F54BF /* GlobalContextWithFinalizerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE0D4A071ABA2437002F54BF /* GlobalContextWithFinalizerTest.cpp */; };
</span><ins>+                FE1C0FFD1B193E9800B53FCA /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1C0FFC1B193E9800B53FCA /* Exception.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FE1C0FFF1B194FD100B53FCA /* Exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE1C0FFE1B194FD100B53FCA /* Exception.cpp */; };
</ins><span class="cx">                 FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; };
</span><span class="cx">                 FE20CE9E15F04A9500DF3430 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE384EE51ADDB7AD0055DE2C /* JSDollarVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE384EE11ADDB7AD0055DE2C /* JSDollarVM.cpp */; };
</span><span class="lines">@@ -3463,6 +3465,8 @@
</span><span class="cx">                 FE0D4A051AB8DD0A002F54BF /* ExecutionTimeLimitTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionTimeLimitTest.h; path = API/tests/ExecutionTimeLimitTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE0D4A071ABA2437002F54BF /* GlobalContextWithFinalizerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GlobalContextWithFinalizerTest.cpp; path = API/tests/GlobalContextWithFinalizerTest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE0D4A081ABA2437002F54BF /* GlobalContextWithFinalizerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalContextWithFinalizerTest.h; path = API/tests/GlobalContextWithFinalizerTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FE1C0FFC1B193E9800B53FCA /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE1C0FFE1B194FD100B53FCA /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Exception.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntCLoop.cpp; path = llint/LLIntCLoop.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntCLoop.h; path = llint/LLIntCLoop.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE384EE11ADDB7AD0055DE2C /* JSDollarVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDollarVM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4427,6 +4431,8 @@
</span><span class="cx">                                 BC02E98B0E183E38000F9297 /* ErrorInstance.h */,
</span><span class="cx">                                 BC02E9060E1839DB000F9297 /* ErrorPrototype.cpp */,
</span><span class="cx">                                 BC02E9070E1839DB000F9297 /* ErrorPrototype.h */,
</span><ins>+                                FE1C0FFC1B193E9800B53FCA /* Exception.h */,
+                                FE1C0FFE1B194FD100B53FCA /* Exception.cpp */,
</ins><span class="cx">                                 0F12DE0D1979D5FD0006FF4E /* ExceptionFuzz.cpp */,
</span><span class="cx">                                 0F12DE0E1979D5FD0006FF4E /* ExceptionFuzz.h */,
</span><span class="cx">                                 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */,
</span><span class="lines">@@ -5624,6 +5630,7 @@
</span><span class="cx">                                 FE4D55B81AE716CA0052E459 /* IterationStatus.h in Headers */,
</span><span class="cx">                                 FE5068651AE246390009DAB7 /* DeferredSourceDump.h in Headers */,
</span><span class="cx">                                 C442CB251A6CDB8C005D3D7C /* JSInputs.json in Headers */,
</span><ins>+                                FE1C0FFD1B193E9800B53FCA /* Exception.h in Headers */,
</ins><span class="cx">                                 52678F911A04177C006A306D /* ControlFlowProfiler.h in Headers */,
</span><span class="cx">                                 52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */,
</span><span class="cx">                                 A5EA710E19F6DF810098F5EC /* InspectorAlternateBackendDispatchers.h in Headers */,
</span><span class="lines">@@ -7408,6 +7415,7 @@
</span><span class="cx">                                 7C008CDA187124BB00955C24 /* JSPromiseDeferred.cpp in Sources */,
</span><span class="cx">                                 7C008CD2186F8A9300955C24 /* JSPromiseFunctions.cpp in Sources */,
</span><span class="cx">                                 7C184E1E17BEE22E007CB63A /* JSPromisePrototype.cpp in Sources */,
</span><ins>+                                FE1C0FFF1B194FD100B53FCA /* Exception.cpp in Sources */,
</ins><span class="cx">                                 709FB86B1AE335C60039D069 /* WeakSetPrototype.cpp in Sources */,
</span><span class="cx">                                 7C008CDE1871258D00955C24 /* JSPromiseReaction.cpp in Sources */,
</span><span class="cx">                                 862553D116136DA9009F17D0 /* JSProxy.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebindingsScriptFunctionCallcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -133,11 +133,11 @@
</span><span class="cx">         return Deprecated::ScriptValue();
</span><span class="cx"> 
</span><span class="cx">     JSValue result;
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception;
</ins><span class="cx">     if (m_callHandler)
</span><del>-        result = m_callHandler(m_exec, function, callType, callData, thisObject, m_arguments, &amp;exception);
</del><ins>+        result = m_callHandler(m_exec, function, callType, callData, thisObject, m_arguments, exception);
</ins><span class="cx">     else
</span><del>-        result = JSC::call(m_exec, function, callType, callData, thisObject, m_arguments, &amp;exception);
</del><ins>+        result = JSC::call(m_exec, function, callType, callData, thisObject, m_arguments, exception);
</ins><span class="cx"> 
</span><span class="cx">     if (exception) {
</span><span class="cx">         hadException = true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebindingsScriptFunctionCallh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE ScriptFunctionCall : public ScriptCallArgumentHandler {
</span><span class="cx"> public:
</span><del>-    typedef JSC::JSValue (*ScriptFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::JSValue* exception);
</del><ins>+    typedef JSC::JSValue (*ScriptFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::Exception*&amp; exception);
</ins><span class="cx">     ScriptFunctionCall(const ScriptObject&amp; thisObject, const String&amp; name, ScriptFunctionCallHandler handler = nullptr);
</span><span class="cx">     ScriptValue call(bool&amp; hadException);
</span><span class="cx">     ScriptValue call();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">             { &quot;name&quot; : &quot;op_push_with_scope&quot;, &quot;length&quot; : 3 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_pop_scope&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_push_name_scope&quot;, &quot;length&quot; : 5 },
</span><del>-            { &quot;name&quot; : &quot;op_catch&quot;, &quot;length&quot; : 2 },
</del><ins>+            { &quot;name&quot; : &quot;op_catch&quot;, &quot;length&quot; : 3 },
</ins><span class="cx">             { &quot;name&quot; : &quot;op_throw&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw_static_error&quot;, &quot;length&quot; : 3 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_debug&quot;, &quot;length&quot; : 3 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeUseDefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -303,7 +303,6 @@
</span><span class="cx">     case op_resolve_scope:
</span><span class="cx">     case op_strcat:
</span><span class="cx">     case op_to_primitive:
</span><del>-    case op_catch:
</del><span class="cx">     case op_create_this:
</span><span class="cx">     case op_new_array:
</span><span class="cx">     case op_new_array_buffer:
</span><span class="lines">@@ -374,6 +373,7 @@
</span><span class="cx">         functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+    case op_catch:
</ins><span class="cx">     case op_create_lexical_environment: {
</span><span class="cx">         functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
</span><span class="cx">         functor(codeBlock, instruction, opcodeID, instruction[2].u.operand);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1484,7 +1484,9 @@
</span><span class="cx">         }
</span><span class="cx">         case op_catch: {
</span><span class="cx">             int r0 = (++it)-&gt;u.operand;
</span><del>-            printLocationOpAndRegisterOperand(out, exec, location, it, &quot;catch&quot;, r0);
</del><ins>+            int r1 = (++it)-&gt;u.operand;
+            printLocationAndOp(out, exec, location, it, &quot;catch&quot;);
+            out.printf(&quot;%s, %s&quot;, registerName(r0).data(), registerName(r1).data());
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case op_throw: {
</span><span class="lines">@@ -2878,7 +2880,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
</del><ins>+HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset, RequiredHandler requiredHandler)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(bytecodeOffset &lt; instructions().size());
</span><span class="cx"> 
</span><span class="lines">@@ -2888,6 +2890,9 @@
</span><span class="cx">     Vector&lt;HandlerInfo&gt;&amp; exceptionHandlers = m_rareData-&gt;m_exceptionHandlers;
</span><span class="cx">     for (size_t i = 0; i &lt; exceptionHandlers.size(); ++i) {
</span><span class="cx">         HandlerInfo&amp; handler = exceptionHandlers[i];
</span><ins>+        if ((requiredHandler == RequiredHandler::CatchHandler) &amp;&amp; !handler.isCatchHandler())
+            continue;
+
</ins><span class="cx">         // Handlers are ordered innermost first, so the first handler we encounter
</span><span class="cx">         // that contains the source address is the correct handler to use.
</span><span class="cx">         if (handler.start &lt;= bytecodeOffset &amp;&amp; handler.end &gt; bytecodeOffset)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -185,7 +185,11 @@
</span><span class="cx">         return index &gt;= m_numVars;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    HandlerInfo* handlerForBytecodeOffset(unsigned bytecodeOffset);
</del><ins>+    enum class RequiredHandler {
+        CatchHandler,
+        AnyHandler
+    };
+    HandlerInfo* handlerForBytecodeOffset(unsigned bytecodeOffset, RequiredHandler = RequiredHandler::AnyHandler);
</ins><span class="cx">     unsigned lineNumberForBytecodeOffset(unsigned bytecodeOffset);
</span><span class="cx">     unsigned columnNumberForBytecodeOffset(unsigned bytecodeOffset);
</span><span class="cx">     void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int&amp; divot,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeHandlerInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> struct HandlerInfoBase {
</span><span class="cx">     HandlerType type() const { return static_cast&lt;HandlerType&gt;(typeBits); }
</span><span class="cx">     void setType(HandlerType type) { typeBits = static_cast&lt;uint32_t&gt;(type); }
</span><del>-    
</del><ins>+
</ins><span class="cx">     const char* typeName()
</span><span class="cx">     {
</span><span class="cx">         switch (type()) {
</span><span class="lines">@@ -55,9 +55,9 @@
</span><span class="cx">         }
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     bool isCatchHandler() const { return type() == HandlerType::Catch; }
</span><del>-    
</del><ins>+
</ins><span class="cx">     uint32_t start;
</span><span class="cx">     uint32_t end;
</span><span class="cx">     uint32_t target;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -2528,7 +2528,7 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RegisterID* BytecodeGenerator::popTryAndEmitCatch(TryData* tryData, RegisterID* targetRegister, Label* end, HandlerType handlerType)
</del><ins>+void BytecodeGenerator::popTryAndEmitCatch(TryData* tryData, RegisterID* exceptionRegister, RegisterID* thrownValueRegister, Label* end, HandlerType handlerType)
</ins><span class="cx"> {
</span><span class="cx">     m_usesExceptions = true;
</span><span class="cx">     
</span><span class="lines">@@ -2546,8 +2546,8 @@
</span><span class="cx">     tryRange.tryData-&gt;handlerType = handlerType;
</span><span class="cx"> 
</span><span class="cx">     emitOpcode(op_catch);
</span><del>-    instructions().append(targetRegister-&gt;index());
-    return targetRegister;
</del><ins>+    instructions().append(exceptionRegister-&gt;index());
+    instructions().append(thrownValueRegister-&gt;index());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BytecodeGenerator::emitThrowReferenceError(const String&amp; message)
</span><span class="lines">@@ -2760,7 +2760,11 @@
</span><span class="cx">         // IteratorClose sequence for throw-ed control flow.
</span><span class="cx">         {
</span><span class="cx">             RefPtr&lt;Label&gt; catchHere = emitLabel(newLabel().get());
</span><del>-            RefPtr&lt;RegisterID&gt; exceptionRegister = popTryAndEmitCatch(tryData, newTemporary(), catchHere.get(), HandlerType::SynthesizedFinally);
</del><ins>+            RefPtr&lt;RegisterID&gt; exceptionRegister = newTemporary();
+            RefPtr&lt;RegisterID&gt; thrownValueRegister = newTemporary();
+            popTryAndEmitCatch(tryData, exceptionRegister.get(),
+                thrownValueRegister.get(), catchHere.get(), HandlerType::SynthesizedFinally);
+
</ins><span class="cx">             RefPtr&lt;Label&gt; catchDone = newLabel();
</span><span class="cx"> 
</span><span class="cx">             RefPtr&lt;RegisterID&gt; returnMethod = emitGetById(newTemporary(), iterator.get(), propertyNames().returnKeyword);
</span><span class="lines">@@ -2778,7 +2782,8 @@
</span><span class="cx">             emitThrow(exceptionRegister.get());
</span><span class="cx"> 
</span><span class="cx">             // Absorb exception.
</span><del>-            popTryAndEmitCatch(returnCallTryData, newTemporary(), catchDone.get(), HandlerType::SynthesizedFinally);
</del><ins>+            popTryAndEmitCatch(returnCallTryData, newTemporary(),
+                newTemporary(), catchDone.get(), HandlerType::SynthesizedFinally);
</ins><span class="cx">             emitThrow(exceptionRegister.get());
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -553,7 +553,7 @@
</span><span class="cx">         // Start a try block. 'start' must have been emitted.
</span><span class="cx">         TryData* pushTry(Label* start);
</span><span class="cx">         // End a try block. 'end' must have been emitted.
</span><del>-        RegisterID* popTryAndEmitCatch(TryData*, RegisterID* targetRegister, Label* end, HandlerType);
</del><ins>+        void popTryAndEmitCatch(TryData*, RegisterID* exceptionRegister, RegisterID* thrownValueRegister, Label* end, HandlerType);
</ins><span class="cx"> 
</span><span class="cx">         void emitThrow(RegisterID* exc)
</span><span class="cx">         { 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -2881,7 +2881,9 @@
</span><span class="cx"> 
</span><span class="cx">         // Uncaught exception path: the catch block.
</span><span class="cx">         RefPtr&lt;Label&gt; here = generator.emitLabel(generator.newLabel().get());
</span><del>-        RefPtr&lt;RegisterID&gt; exceptionRegister = generator.popTryAndEmitCatch(tryData, generator.newTemporary(), here.get(), HandlerType::Catch);
</del><ins>+        RefPtr&lt;RegisterID&gt; exceptionRegister = generator.newTemporary();
+        RefPtr&lt;RegisterID&gt; thrownValueRegister = generator.newTemporary();
+        generator.popTryAndEmitCatch(tryData, exceptionRegister.get(), thrownValueRegister.get(), here.get(), HandlerType::Catch);
</ins><span class="cx">         
</span><span class="cx">         if (m_finallyBlock) {
</span><span class="cx">             // If the catch block throws an exception and we have a finally block, then the finally
</span><span class="lines">@@ -2889,7 +2891,7 @@
</span><span class="cx">             tryData = generator.pushTry(here.get());
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        generator.emitPushCatchScope(generator.scopeRegister(), m_exceptionIdent, exceptionRegister.get(), DontDelete);
</del><ins>+        generator.emitPushCatchScope(generator.scopeRegister(), m_thrownValueIdent, thrownValueRegister.get(), DontDelete);
</ins><span class="cx">         generator.emitProfileControlFlow(m_tryBlock-&gt;endOffset() + 1);
</span><span class="cx">         generator.emitNode(dst, m_catchBlock);
</span><span class="cx">         generator.emitPopScope(generator.scopeRegister());
</span><span class="lines">@@ -2912,10 +2914,12 @@
</span><span class="cx">         generator.emitJump(finallyEndLabel.get());
</span><span class="cx"> 
</span><span class="cx">         // Uncaught exception path: invoke the finally block, then re-throw the exception.
</span><del>-        RefPtr&lt;RegisterID&gt; tempExceptionRegister = generator.popTryAndEmitCatch(tryData, generator.newTemporary(), preFinallyLabel.get(), HandlerType::Finally);
</del><ins>+        RefPtr&lt;RegisterID&gt; exceptionRegister = generator.newTemporary();
+        RefPtr&lt;RegisterID&gt; thrownValueRegister = generator.newTemporary();
+        generator.popTryAndEmitCatch(tryData, exceptionRegister.get(), thrownValueRegister.get(), preFinallyLabel.get(), HandlerType::Finally);
</ins><span class="cx">         generator.emitProfileControlFlow(finallyStartOffset);
</span><span class="cx">         generator.emitNode(dst, m_finallyBlock);
</span><del>-        generator.emitThrow(tempExceptionRegister.get());
</del><ins>+        generator.emitThrow(exceptionRegister.get());
</ins><span class="cx"> 
</span><span class="cx">         generator.emitLabel(finallyEndLabel.get());
</span><span class="cx">         generator.emitProfileControlFlow(m_finallyBlock-&gt;endOffset() + 1);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -487,7 +487,7 @@
</span><span class="cx">     // so make it looks like the debugger is already paused.
</span><span class="cx">     TemporaryPausedState pausedState(*this);
</span><span class="cx"> 
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception;
</ins><span class="cx">     DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
</span><span class="cx">     JSValue result = debuggerCallFrame-&gt;evaluate(breakpoint-&gt;condition, exception);
</span><span class="cx"> 
</span><span class="lines">@@ -695,13 +695,13 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Debugger::exception(CallFrame* callFrame, JSValue exception, bool hasHandler)
</del><ins>+void Debugger::exception(CallFrame* callFrame, JSValue exception, bool hasCatchHandler)
</ins><span class="cx"> {
</span><span class="cx">     if (m_isPaused)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     PauseReasonDeclaration reason(*this, PausedForException);
</span><del>-    if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions &amp;&amp; !hasHandler)) {
</del><ins>+    if (m_pauseOnExceptionsState == PauseOnAllExceptions || (m_pauseOnExceptionsState == PauseOnUncaughtExceptions &amp;&amp; !hasCatchHandler)) {
</ins><span class="cx">         m_pauseOnNextStatement = true;
</span><span class="cx">         setSteppingMode(SteppingModeEnabled);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String&amp; errorMessage) = 0;
</span><span class="cx"> 
</span><del>-    void exception(CallFrame*, JSValue exceptionValue, bool hasHandler);
</del><ins>+    void exception(CallFrame*, JSValue exceptionValue, bool hasCatchHandler);
</ins><span class="cx">     void atStatement(CallFrame*);
</span><span class="cx">     void callEvent(CallFrame*);
</span><span class="cx">     void returnEvent(CallFrame*);
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> protected:
</span><span class="cx">     virtual bool needPauseHandling(JSGlobalObject*) { return false; }
</span><span class="cx">     virtual void handleBreakpointHit(JSGlobalObject*, const Breakpoint&amp;) { }
</span><del>-    virtual void handleExceptionInBreakpointCondition(ExecState*, JSValue exception) const { UNUSED_PARAM(exception); }
</del><ins>+    virtual void handleExceptionInBreakpointCondition(ExecState*, Exception*) const { }
</ins><span class="cx">     virtual void handlePause(JSGlobalObject*, ReasonForPause) { }
</span><span class="cx">     virtual void notifyDoneProcessingDebuggerEvents() { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;DebuggerEvalEnabler.h&quot;
</span><span class="cx"> #include &quot;DebuggerScope.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;JSFunction.h&quot;
</span><span class="cx"> #include &quot;JSLexicalEnvironment.h&quot;
</span><span class="lines">@@ -176,7 +177,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Evaluate some JavaScript code in the scope of this frame.
</span><del>-JSValue DebuggerCallFrame::evaluate(const String&amp; script, JSValue&amp; exception)
</del><ins>+JSValue DebuggerCallFrame::evaluate(const String&amp; script, Exception*&amp; exception)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isValid());
</span><span class="cx">     CallFrame* callFrame = m_callFrame;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> class DebuggerScope;
</span><ins>+class Exception;
</ins><span class="cx"> class ExecState;
</span><span class="cx"> typedef ExecState CallFrame;
</span><span class="cx"> 
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx">     JS_EXPORT_PRIVATE String functionName() const;
</span><span class="cx">     JS_EXPORT_PRIVATE Type type() const;
</span><span class="cx">     JS_EXPORT_PRIVATE JSValue thisValue() const;
</span><del>-    JSValue evaluate(const String&amp;, JSValue&amp; exception);
</del><ins>+    JSValue evaluate(const String&amp;, Exception*&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool isValid() const { return !!m_callFrame; }
</span><span class="cx">     JS_EXPORT_PRIVATE void invalidate();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -139,9 +139,9 @@
</span><span class="cx">     JSGlobalObject* globalObject = scriptState-&gt;lexicalGlobalObject();
</span><span class="cx">     JSValue globalThisValue = scriptState-&gt;globalThisValue();
</span><span class="cx"> 
</span><del>-    JSValue evaluationException;
</del><ins>+    Exception* evaluationException;
</ins><span class="cx">     InspectorEvaluateHandler evaluateHandler = m_environment.evaluateHandler();
</span><del>-    JSValue functionValue = evaluateHandler(scriptState, sourceCode, globalThisValue, &amp;evaluationException);
</del><ins>+    JSValue functionValue = evaluateHandler(scriptState, sourceCode, globalThisValue, evaluationException);
</ins><span class="cx">     if (evaluationException)
</span><span class="cx">         return Deprecated::ScriptObject();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInspectorEnvironmenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -33,13 +33,14 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><ins>+class Exception;
</ins><span class="cx"> class SourceCode;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><del>-typedef JSC::JSValue (*InspectorFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::JSValue* exception);
-typedef JSC::JSValue (*InspectorEvaluateHandler)(JSC::ExecState*, const JSC::SourceCode&amp;, JSC::JSValue thisValue, JSC::JSValue* exception);
</del><ins>+typedef JSC::JSValue (*InspectorFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::Exception*&amp; returnedException);
+typedef JSC::JSValue (*InspectorEvaluateHandler)(JSC::ExecState*, const JSC::SourceCode&amp;, JSC::JSValue thisValue, JSC::Exception*&amp; returnedException);
</ins><span class="cx"> 
</span><span class="cx"> class InspectorEnvironment {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;Completion.h&quot;
</span><span class="cx"> #include &quot;ConsoleMessage.h&quot;
</span><span class="cx"> #include &quot;ErrorHandlingScope.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;InjectedScriptHost.h&quot;
</span><span class="cx"> #include &quot;InjectedScriptManager.h&quot;
</span><span class="cx"> #include &quot;InspectorAgent.h&quot;
</span><span class="lines">@@ -188,7 +189,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSGlobalObjectInspectorController::reportAPIException(ExecState* exec, JSValue exception)
</del><ins>+void JSGlobalObjectInspectorController::reportAPIException(ExecState* exec, Exception* exception)
</ins><span class="cx"> {
</span><span class="cx">     if (isTerminatedExecutionException(exception))
</span><span class="cx">         return;
</span><span class="lines">@@ -201,7 +202,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: &lt;http://webkit.org/b/115087&gt; Web Inspector: Should not evaluate JavaScript handling exceptions
</span><span class="cx">     // If this is a custom exception object, call toString on it to try and get a nice string representation for the exception.
</span><del>-    String errorMessage = exception.toString(exec)-&gt;value(exec);
</del><ins>+    String errorMessage = exception-&gt;value().toString(exec)-&gt;value(exec);
</ins><span class="cx">     exec-&gt;clearException();
</span><span class="cx"> 
</span><span class="cx">     if (JSGlobalObjectConsoleClient::logToSystemConsole()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ConsoleClient;
</span><ins>+class Exception;
</ins><span class="cx"> class ExecState;
</span><span class="cx"> class JSGlobalObject;
</span><span class="cx"> class JSValue;
</span><span class="lines">@@ -81,7 +82,7 @@
</span><span class="cx">     void setIncludesNativeCallStackWhenReportingExceptions(bool includesNativeCallStack) { m_includeNativeCallStackWithExceptions = includesNativeCallStack; }
</span><span class="cx"> 
</span><span class="cx">     void pause();
</span><del>-    void reportAPIException(JSC::ExecState*, JSC::JSValue exception);
</del><ins>+    void reportAPIException(JSC::ExecState*, JSC::Exception*);
</ins><span class="cx"> 
</span><span class="cx">     JSC::ConsoleClient* consoleClient() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     // NOTE: Currently all exceptions are reported at the API boundary through reportAPIException.
</span><span class="cx">     // Until a time comes where an exception can be caused outside of the API (e.g. setTimeout
</span><span class="cx">     // or some other async operation in a pure JSContext) we can ignore exceptions reported here.
</span><del>-    virtual void reportException(JSC::ExecState*, JSC::JSValue) const override { }
</del><ins>+    virtual void reportException(JSC::ExecState*, JSC::Exception*) const override { }
</ins><span class="cx"> 
</span><span class="cx">     ListenerSet m_listeners;
</span><span class="cx">     JSC::JSGlobalObject&amp; m_globalObject;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DebuggerScope.h&quot;
</span><span class="cx"> #include &quot;Error.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> #include &quot;JSCellInlines.h&quot;
</span><span class="cx"> #include &quot;JSJavaScriptCallFramePrototype.h&quot;
</span><span class="lines">@@ -75,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSJavaScriptCallFrame::evaluate(ExecState* exec)
</span><span class="cx"> {
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception;
</ins><span class="cx">     JSValue result = impl().evaluate(exec-&gt;argument(0).toString(exec)-&gt;value(exec), exception);
</span><span class="cx">     if (exception)
</span><span class="cx">         exec-&gt;vm().throwException(exec, exception);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJavaScriptCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     JSC::JSGlobalObject* vmEntryGlobalObject() const { return m_debuggerCallFrame-&gt;vmEntryGlobalObject(); }
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue thisValue() const { return m_debuggerCallFrame-&gt;thisValue(); }
</span><del>-    JSC::JSValue evaluate(const String&amp; script, JSC::JSValue&amp; exception) const  { return m_debuggerCallFrame-&gt;evaluate(script, exception); }
</del><ins>+    JSC::JSValue evaluate(const String&amp; script, JSC::Exception*&amp; exception) const  { return m_debuggerCallFrame-&gt;evaluate(script, exception); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     JavaScriptCallFrame(PassRefPtr&lt;JSC::DebuggerCallFrame&gt;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;ScriptCallStackFactory.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;ScriptArguments.h&quot;
</span><span class="lines">@@ -128,10 +129,10 @@
</span><span class="cx">     exec-&gt;clearException();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;ScriptCallStack&gt; createScriptCallStackFromException(JSC::ExecState* exec, JSC::JSValue&amp; exception, size_t maxStackSize)
</del><ins>+PassRefPtr&lt;ScriptCallStack&gt; createScriptCallStackFromException(JSC::ExecState* exec, JSC::Exception* exception, size_t maxStackSize)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;ScriptCallFrame&gt; frames;
</span><del>-    RefCountedArray&lt;StackFrame&gt; stackTrace = exec-&gt;vm().exceptionStack();
</del><ins>+    RefCountedArray&lt;StackFrame&gt; stackTrace = exception-&gt;stack();
</ins><span class="cx">     for (size_t i = 0; i &lt; stackTrace.size() &amp;&amp; i &lt; maxStackSize; i++) {
</span><span class="cx">         unsigned line;
</span><span class="cx">         unsigned column;
</span><span class="lines">@@ -141,8 +142,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Fallback to getting at least the line and sourceURL from the exception object if it has values and the exceptionStack doesn't.
</span><del>-    JSObject* exceptionObject = exception.toObject(exec);
-    if (exception.isObject()) {
</del><ins>+    if (exception-&gt;value().isObject()) {
+        JSObject* exceptionObject = exception-&gt;value().toObject(exec);
</ins><span class="cx">         int lineNumber;
</span><span class="cx">         int columnNumber;
</span><span class="cx">         String exceptionSourceURL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><ins>+class Exception;
</ins><span class="cx"> class ExecState;
</span><span class="cx"> class JSValue;
</span><span class="cx"> }
</span><span class="lines">@@ -47,7 +48,7 @@
</span><span class="cx"> // FIXME: The subtle differences between these should be eliminated.
</span><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr&lt;ScriptCallStack&gt; createScriptCallStack(JSC::ExecState*, size_t maxStackSize);
</span><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr&lt;ScriptCallStack&gt; createScriptCallStackForConsole(JSC::ExecState*, size_t maxStackSize);
</span><del>-JS_EXPORT_PRIVATE PassRefPtr&lt;ScriptCallStack&gt; createScriptCallStackFromException(JSC::ExecState*, JSC::JSValue&amp; exception, size_t maxStackSize);
</del><ins>+JS_EXPORT_PRIVATE PassRefPtr&lt;ScriptCallStack&gt; createScriptCallStackFromException(JSC::ExecState*, JSC::Exception*, size_t maxStackSize);
</ins><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr&lt;ScriptArguments&gt; createScriptArguments(JSC::ExecState*, unsigned skipArgumentCount);
</span><span class="cx"> 
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DebuggerCallFrame.h&quot;
</span><span class="cx"> #include &quot;DebuggerScope.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSJavaScriptCallFrame.h&quot;
</span><span class="cx"> #include &quot;JSLock.h&quot;
</span><span class="cx"> #include &quot;JavaScriptCallFrame.h&quot;
</span><span class="lines">@@ -93,7 +94,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     case ScriptBreakpointActionTypeEvaluate: {
</span><del>-        JSValue exception;
</del><ins>+        Exception* exception;
</ins><span class="cx">         debuggerCallFrame-&gt;evaluate(breakpointAction.data, exception);
</span><span class="cx">         if (exception)
</span><span class="cx">             reportException(debuggerCallFrame-&gt;exec(), exception);
</span><span class="lines">@@ -103,13 +104,13 @@
</span><span class="cx">         dispatchBreakpointActionSound(debuggerCallFrame-&gt;exec(), breakpointAction.identifier);
</span><span class="cx">         break;
</span><span class="cx">     case ScriptBreakpointActionTypeProbe: {
</span><del>-        JSValue exception;
</del><ins>+        Exception* exception;
</ins><span class="cx">         JSValue result = debuggerCallFrame-&gt;evaluate(breakpointAction.data, exception);
</span><span class="cx">         if (exception)
</span><span class="cx">             reportException(debuggerCallFrame-&gt;exec(), exception);
</span><span class="cx">         
</span><span class="cx">         JSC::ExecState* state = debuggerCallFrame-&gt;scope()-&gt;globalObject()-&gt;globalExec();
</span><del>-        Deprecated::ScriptValue wrappedResult = Deprecated::ScriptValue(state-&gt;vm(), exception ? exception : result);
</del><ins>+        Deprecated::ScriptValue wrappedResult = Deprecated::ScriptValue(state-&gt;vm(), exception ? exception-&gt;value() : result);
</ins><span class="cx">         dispatchBreakpointActionProbe(state, breakpointAction, wrappedResult);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -302,7 +303,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScriptDebugServer::handleExceptionInBreakpointCondition(JSC::ExecState* exec, JSC::JSValue exception) const
</del><ins>+void ScriptDebugServer::handleExceptionInBreakpointCondition(JSC::ExecState* exec, JSC::Exception* exception) const
</ins><span class="cx"> {
</span><span class="cx">     reportException(exec, exception);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     virtual void didContinue(JSC::JSGlobalObject*) = 0;
</span><span class="cx">     virtual void runEventLoopWhilePaused() = 0;
</span><span class="cx">     virtual bool isContentScript(JSC::ExecState*) const = 0;
</span><del>-    virtual void reportException(JSC::ExecState*, JSC::JSValue) const = 0;
</del><ins>+    virtual void reportException(JSC::ExecState*, JSC::Exception*) const = 0;
</ins><span class="cx"> 
</span><span class="cx">     bool evaluateBreakpointAction(const ScriptBreakpointAction&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">     virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const String&amp; errorMsg) override final;
</span><span class="cx">     virtual bool needPauseHandling(JSC::JSGlobalObject*) override final { return true; }
</span><span class="cx">     virtual void handleBreakpointHit(JSC::JSGlobalObject*, const JSC::Breakpoint&amp;) override final;
</span><del>-    virtual void handleExceptionInBreakpointCondition(JSC::ExecState*, JSC::JSValue exception) const override final;
</del><ins>+    virtual void handleExceptionInBreakpointCondition(JSC::ExecState*, JSC::Exception*) const override final;
</ins><span class="cx">     virtual void handlePause(JSC::JSGlobalObject*, JSC::Debugger::ReasonForPause) override final;
</span><span class="cx">     virtual void notifyDoneProcessingDebuggerEvents() override final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -24,11 +24,11 @@
</span><span class="cx"> #define CallFrame_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AbstractPC.h&quot;
</span><del>-#include &quot;VM.h&quot;
</del><span class="cx"> #include &quot;JSStack.h&quot;
</span><span class="cx"> #include &quot;MacroAssemblerCodeRef.h&quot;
</span><span class="cx"> #include &quot;Register.h&quot;
</span><span class="cx"> #include &quot;StackVisitor.h&quot;
</span><ins>+#include &quot;VM.h&quot;
</ins><span class="cx"> #include &quot;VMEntryRecord.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC  {
</span><span class="lines">@@ -75,13 +75,9 @@
</span><span class="cx">         // But they're used in many places in legacy code, so they're not going away any time soon.
</span><span class="cx"> 
</span><span class="cx">         void clearException() { vm().clearException(); }
</span><del>-        void clearSupplementaryExceptionInfo()
-        {
-            vm().clearExceptionStack();
-        }
</del><span class="cx"> 
</span><del>-        JSValue exception() const { return vm().exception(); }
-        bool hadException() const { return !vm().exception().isEmpty(); }
</del><ins>+        Exception* exception() const { return vm().exception(); }
+        bool hadException() const { return !!vm().exception(); }
</ins><span class="cx"> 
</span><span class="cx">         AtomicStringTable* atomicStringTable() const { return vm().atomicStringTable(); }
</span><span class="cx">         const CommonIdentifiers&amp; propertyNames() const { return *vm().propertyNames; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &quot;DebuggerCallFrame.h&quot;
</span><span class="cx"> #include &quot;ErrorInstance.h&quot;
</span><span class="cx"> #include &quot;EvalCodeCache.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;ExceptionHelpers.h&quot;
</span><span class="cx"> #include &quot;GetterSetter.h&quot;
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><span class="lines">@@ -435,7 +436,7 @@
</span><span class="cx"> {
</span><span class="cx">     CallFrame* callFrame = visitor-&gt;callFrame();
</span><span class="cx">     if (Debugger* debugger = callFrame-&gt;vmEntryGlobalObject()-&gt;debugger()) {
</span><del>-        ClearExceptionScope scope(&amp;callFrame-&gt;vm());
</del><ins>+        SuspendExceptionScope scope(&amp;callFrame-&gt;vm());
</ins><span class="cx">         if (jsDynamicCast&lt;JSFunction*&gt;(callFrame-&gt;callee()))
</span><span class="cx">             debugger-&gt;returnEvent(callFrame);
</span><span class="cx">         else
</span><span class="lines">@@ -583,9 +584,9 @@
</span><span class="cx">     return jsString(&amp;exec-&gt;vm(), builder.toString());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class GetExceptionHandlerFunctor {
</del><ins>+class GetCatchHandlerFunctor {
</ins><span class="cx"> public:
</span><del>-    GetExceptionHandlerFunctor()
</del><ins>+    GetCatchHandlerFunctor()
</ins><span class="cx">         : m_handler(0)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -599,7 +600,7 @@
</span><span class="cx">             return StackVisitor::Continue;
</span><span class="cx"> 
</span><span class="cx">         unsigned bytecodeOffset = visitor-&gt;bytecodeOffset();
</span><del>-        m_handler = codeBlock-&gt;handlerForBytecodeOffset(bytecodeOffset);
</del><ins>+        m_handler = codeBlock-&gt;handlerForBytecodeOffset(bytecodeOffset, CodeBlock::RequiredHandler::CatchHandler);
</ins><span class="cx">         if (m_handler)
</span><span class="cx">             return StackVisitor::Done;
</span><span class="cx"> 
</span><span class="lines">@@ -649,11 +650,12 @@
</span><span class="cx">     HandlerInfo*&amp; m_handler;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-NEVER_INLINE HandlerInfo* Interpreter::unwind(VMEntryFrame*&amp; vmEntryFrame, CallFrame*&amp; callFrame, JSValue&amp; exceptionValue)
</del><ins>+NEVER_INLINE HandlerInfo* Interpreter::unwind(VMEntryFrame*&amp; vmEntryFrame, CallFrame*&amp; callFrame, Exception* exception)
</ins><span class="cx"> {
</span><span class="cx">     CodeBlock* codeBlock = callFrame-&gt;codeBlock();
</span><span class="cx">     bool isTermination = false;
</span><span class="cx"> 
</span><ins>+    JSValue exceptionValue = exception-&gt;value();
</ins><span class="cx">     ASSERT(!exceptionValue.isEmpty());
</span><span class="cx">     ASSERT(!exceptionValue.isCell() || exceptionValue.asCell());
</span><span class="cx">     // This shouldn't be possible (hence the assertions), but we're already in the slowest of
</span><span class="lines">@@ -662,32 +664,35 @@
</span><span class="cx">         exceptionValue = jsNull();
</span><span class="cx"> 
</span><span class="cx">     if (exceptionValue.isObject())
</span><del>-        isTermination = isTerminatedExecutionException(asObject(exceptionValue));
</del><ins>+        isTermination = isTerminatedExecutionException(exception);
</ins><span class="cx"> 
</span><del>-    ASSERT(callFrame-&gt;vm().exceptionStack().size());
</del><ins>+    ASSERT(callFrame-&gt;vm().exception() &amp;&amp; callFrame-&gt;vm().exception()-&gt;stack().size());
</ins><span class="cx"> 
</span><span class="cx">     Debugger* debugger = callFrame-&gt;vmEntryGlobalObject()-&gt;debugger();
</span><del>-    if (debugger &amp;&amp; debugger-&gt;needsExceptionCallbacks()) {
-        // We need to clear the exception and the exception stack here in order to see if a new exception happens.
</del><ins>+    if (debugger &amp;&amp; debugger-&gt;needsExceptionCallbacks() &amp;&amp; !exception-&gt;didNotifyInspectorOfThrow()) {
+        // We need to clear the exception here in order to see if a new exception happens.
</ins><span class="cx">         // Afterwards, the values are put back to continue processing this error.
</span><del>-        ClearExceptionScope scope(&amp;callFrame-&gt;vm());
</del><ins>+        SuspendExceptionScope scope(&amp;callFrame-&gt;vm());
</ins><span class="cx">         // This code assumes that if the debugger is enabled then there is no inlining.
</span><span class="cx">         // If that assumption turns out to be false then we'll ignore the inlined call
</span><span class="cx">         // frames.
</span><span class="cx">         // https://bugs.webkit.org/show_bug.cgi?id=121754
</span><span class="cx"> 
</span><del>-        bool hasHandler;
</del><ins>+        bool hasCatchHandler;
</ins><span class="cx">         if (isTermination)
</span><del>-            hasHandler = false;
</del><ins>+            hasCatchHandler = false;
</ins><span class="cx">         else {
</span><del>-            GetExceptionHandlerFunctor functor;
</del><ins>+            GetCatchHandlerFunctor functor;
</ins><span class="cx">             callFrame-&gt;iterate(functor);
</span><del>-            hasHandler = !!functor.handler();
</del><ins>+            HandlerInfo* handler = functor.handler();
+            ASSERT(!handler || handler-&gt;isCatchHandler());
+            hasCatchHandler = !!handler;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        debugger-&gt;exception(callFrame, exceptionValue, hasHandler);
</del><ins>+        debugger-&gt;exception(callFrame, exceptionValue, hasCatchHandler);
</ins><span class="cx">         ASSERT(!callFrame-&gt;hadException());
</span><span class="cx">     }
</span><ins>+    exception-&gt;setDidNotifyInspectorOfThrow();
</ins><span class="cx"> 
</span><span class="cx">     // Calculate an exception handler vPC, unwinding call frames as necessary.
</span><span class="cx">     HandlerInfo* handler = 0;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -98,20 +98,20 @@
</span><span class="cx">         void expressionInfo(int&amp; divot, int&amp; startOffset, int&amp; endOffset, unsigned&amp; line, unsigned&amp; column);
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    class ClearExceptionScope {
</del><ins>+    class SuspendExceptionScope {
</ins><span class="cx">     public:
</span><del>-        ClearExceptionScope(VM* vm): m_vm(vm)
</del><ins>+        SuspendExceptionScope(VM* vm)
+            : m_vm(vm)
</ins><span class="cx">         {
</span><del>-            vm-&gt;getExceptionInfo(oldException, oldExceptionStack);
</del><ins>+            oldException = vm-&gt;exception();
</ins><span class="cx">             vm-&gt;clearException();
</span><span class="cx">         }
</span><del>-        ~ClearExceptionScope()
</del><ins>+        ~SuspendExceptionScope()
</ins><span class="cx">         {
</span><del>-            m_vm-&gt;setExceptionInfo(oldException, oldExceptionStack);
</del><ins>+            m_vm-&gt;setException(oldException);
</ins><span class="cx">         }
</span><span class="cx">     private:
</span><del>-        JSC::JSValue oldException;
-        RefCountedArray&lt;JSC::StackFrame&gt; oldExceptionStack;
</del><ins>+        Exception* oldException;
</ins><span class="cx">         VM* m_vm;
</span><span class="cx">     };
</span><span class="cx">     
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx">         
</span><span class="cx">         SamplingTool* sampler() { return m_sampler.get(); }
</span><span class="cx"> 
</span><del>-        NEVER_INLINE HandlerInfo* unwind(VMEntryFrame*&amp;, CallFrame*&amp;, JSValue&amp;);
</del><ins>+        NEVER_INLINE HandlerInfo* unwind(VMEntryFrame*&amp;, CallFrame*&amp;, Exception*);
</ins><span class="cx">         NEVER_INLINE void debug(CallFrame*, DebugHookID);
</span><span class="cx">         JSString* stackTraceAsString(ExecState*, Vector&lt;StackFrame&gt;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitAssemblyHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx"> #if USE(JSVALUE64)
</span><span class="cx">     result = branchTest64(kind == NormalExceptionCheck ? NonZero : Zero, AbsoluteAddress(vm()-&gt;addressOfException()));
</span><span class="cx"> #elif USE(JSVALUE32_64)
</span><del>-    result = branch32(kind == NormalExceptionCheck ? NotEqual : Equal, AbsoluteAddress(reinterpret_cast&lt;char*&gt;(vm()-&gt;addressOfException()) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag));
</del><ins>+    result = branch32(kind == NormalExceptionCheck ? NotEqual : Equal, AbsoluteAddress(vm()-&gt;addressOfException()), TrustedImm32(0));
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     if (width == NormalJumpWidth)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITExceptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITExceptions.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITExceptions.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/JITExceptions.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -40,16 +40,17 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-void genericUnwind(VM* vm, ExecState* callFrame, JSValue exceptionValue)
</del><ins>+void genericUnwind(VM* vm, ExecState* callFrame)
</ins><span class="cx"> {
</span><span class="cx">     if (Options::breakOnThrow()) {
</span><span class="cx">         dataLog(&quot;In call frame &quot;, RawPointer(callFrame), &quot; for code block &quot;, *callFrame-&gt;codeBlock(), &quot;\n&quot;);
</span><span class="cx">         CRASH();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    RELEASE_ASSERT(exceptionValue);
</del><ins>+    Exception* exception = vm-&gt;exception();
+    RELEASE_ASSERT(exception);
</ins><span class="cx">     VMEntryFrame* vmEntryFrame = vm-&gt;topVMEntryFrame;
</span><del>-    HandlerInfo* handler = vm-&gt;interpreter-&gt;unwind(vmEntryFrame, callFrame, exceptionValue); // This may update vmEntryFrame and callFrame.
</del><ins>+    HandlerInfo* handler = vm-&gt;interpreter-&gt;unwind(vmEntryFrame, callFrame, exception); // This may update vmEntryFrame and callFrame.
</ins><span class="cx"> 
</span><span class="cx">     void* catchRoutine;
</span><span class="cx">     Instruction* catchPCForInterpreter = 0;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITExceptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITExceptions.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITExceptions.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/JITExceptions.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> class ExecState;
</span><span class="cx"> class VM;
</span><span class="cx"> 
</span><del>-void genericUnwind(VM*, ExecState*, JSValue exceptionValue);
</del><ins>+void genericUnwind(VM*, ExecState*);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;BasicBlockLocation.h&quot;
</span><span class="cx"> #include &quot;CopiedSpaceInlines.h&quot;
</span><span class="cx"> #include &quot;Debugger.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;Heap.h&quot;
</span><span class="cx"> #include &quot;JITInlines.h&quot;
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><span class="lines">@@ -529,6 +530,9 @@
</span><span class="cx">     load64(Address(regT3, VM::exceptionOffset()), regT0);
</span><span class="cx">     store64(TrustedImm64(JSValue::encode(JSValue())), Address(regT3, VM::exceptionOffset()));
</span><span class="cx">     emitPutVirtualRegister(currentInstruction[1].u.operand);
</span><ins>+
+    load64(Address(regT0, Exception::valueOffset()), regT0);
+    emitPutVirtualRegister(currentInstruction[2].u.operand);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_switch_imm(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CCallHelpers.h&quot;
</span><span class="cx"> #include &quot;Debugger.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JITInlines.h&quot;
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><span class="cx"> #include &quot;JSCell.h&quot;
</span><span class="lines">@@ -97,7 +98,7 @@
</span><span class="cx"> #endif // CPU(X86)
</span><span class="cx"> 
</span><span class="cx">     // Check for an exception
</span><del>-    Jump sawException = branch32(NotEqual, AbsoluteAddress(reinterpret_cast&lt;char*&gt;(vm-&gt;addressOfException()) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag)); 
</del><ins>+    Jump sawException = branch32(NotEqual, AbsoluteAddress(vm-&gt;addressOfException()), TrustedImm32(0));
</ins><span class="cx"> 
</span><span class="cx">     emitFunctionEpilogue();
</span><span class="cx">     // Return.
</span><span class="lines">@@ -829,13 +830,19 @@
</span><span class="cx">     addPtr(TrustedImm32(stackPointerOffsetFor(codeBlock()) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</span><span class="cx"> 
</span><span class="cx">     // Now store the exception returned by operationThrow.
</span><del>-    load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
-    load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
-    store32(TrustedImm32(JSValue().payload()), Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
-    store32(TrustedImm32(JSValue().tag()), Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
</del><ins>+    load32(Address(regT3, VM::exceptionOffset()), regT2);
+    move(TrustedImm32(JSValue::CellTag), regT1);
</ins><span class="cx"> 
</span><ins>+    store32(TrustedImm32(0), Address(regT3, VM::exceptionOffset()));
+
</ins><span class="cx">     unsigned exception = currentInstruction[1].u.operand;
</span><del>-    emitStore(exception, regT1, regT0);
</del><ins>+    emitStore(exception, regT1, regT2);
+
+    load32(Address(regT2, Exception::valueOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
+    load32(Address(regT2, Exception::valueOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
+
+    unsigned thrownValue = currentInstruction[2].u.operand;
+    emitStore(thrownValue, regT1, regT0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT::emit_op_switch_imm(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1918,7 +1918,7 @@
</span><span class="cx">     vm-&gt;throwException(exec, exceptionValue);
</span><span class="cx"> 
</span><span class="cx">     // Results stored out-of-band in vm.targetMachinePCForThrow, vm.callFrameForThrow &amp; vm.vmEntryFrameForThrow
</span><del>-    genericUnwind(vm, exec, exceptionValue);
</del><ins>+    genericUnwind(vm, exec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JIT_OPERATION operationFlushWriteBarrierBuffer(ExecState* exec, JSCell* cell)
</span><span class="lines">@@ -1957,11 +1957,7 @@
</span><span class="cx"> void JIT_OPERATION lookupExceptionHandler(VM* vm, ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><del>-
-    JSValue exceptionValue = vm-&gt;exception();
-    ASSERT(exceptionValue);
-    
-    genericUnwind(vm, exec, exceptionValue);
</del><ins>+    genericUnwind(vm, exec);
</ins><span class="cx">     ASSERT(vm-&gt;targetMachinePCForThrow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1972,11 +1968,7 @@
</span><span class="cx">     ASSERT(callerFrame);
</span><span class="cx"> 
</span><span class="cx">     NativeCallFrameTracerWithRestore tracer(vm, vmEntryFrame, callerFrame);
</span><del>-
-    JSValue exceptionValue = vm-&gt;exception();
-    ASSERT(exceptionValue);
-    
-    genericUnwind(vm, callerFrame, exceptionValue);
</del><ins>+    genericUnwind(vm, callerFrame);
</ins><span class="cx">     ASSERT(vm-&gt;targetMachinePCForThrow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1984,8 +1976,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><del>-
-    genericUnwind(vm, exec, vm-&gt;exception());
</del><ins>+    genericUnwind(vm, exec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This function &quot;should&quot; just take the ExecState*, but doing so would make it more difficult
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitThunkGeneratorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -349,8 +349,8 @@
</span><span class="cx"> #else
</span><span class="cx">     JSInterfaceJIT::Jump exceptionHandler = jit.branch32(
</span><span class="cx">         JSInterfaceJIT::NotEqual,
</span><del>-        JSInterfaceJIT::AbsoluteAddress(reinterpret_cast&lt;char*&gt;(vm-&gt;addressOfException()) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)),
-        JSInterfaceJIT::TrustedImm32(JSValue::EmptyValueTag));
</del><ins>+        JSInterfaceJIT::AbsoluteAddress(vm-&gt;addressOfException()),
+        JSInterfaceJIT::TrustedImm32(0));
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     jit.emitFunctionEpilogue();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;Completion.h&quot;
</span><span class="cx"> #include &quot;CopiedSpaceInlines.h&quot;
</span><span class="cx"> #include &quot;Disassembler.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;ExceptionHelpers.h&quot;
</span><span class="cx"> #include &quot;HeapStatistics.h&quot;
</span><span class="cx"> #include &quot;InitializeThreading.h&quot;
</span><span class="lines">@@ -899,13 +900,13 @@
</span><span class="cx">     globalObject-&gt;putDirect(
</span><span class="cx">         exec-&gt;vm(), Identifier::fromString(globalObject-&gt;globalExec(), &quot;arguments&quot;), array);
</span><span class="cx"> 
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception;
</ins><span class="cx">     StopWatch stopWatch;
</span><span class="cx">     stopWatch.start();
</span><del>-    evaluate(globalObject-&gt;globalExec(), jscSource(script.data(), fileName), JSValue(), &amp;exception);
</del><ins>+    evaluate(globalObject-&gt;globalExec(), jscSource(script.data(), fileName), JSValue(), exception);
</ins><span class="cx">     stopWatch.stop();
</span><span class="cx"> 
</span><del>-    if (!!exception) {
</del><ins>+    if (exception) {
</ins><span class="cx">         exec-&gt;vm().throwException(globalObject-&gt;globalExec(), exception);
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="lines">@@ -922,8 +923,8 @@
</span><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();
</span><span class="cx">     
</span><del>-    JSValue evaluationException;
-    JSValue result = evaluate(globalObject-&gt;globalExec(), jscSource(script.data(), fileName), JSValue(), &amp;evaluationException);
</del><ins>+    Exception* evaluationException;
+    JSValue result = evaluate(globalObject-&gt;globalExec(), jscSource(script.data(), fileName), JSValue(), evaluationException);
</ins><span class="cx">     if (evaluationException)
</span><span class="cx">         exec-&gt;vm().throwException(exec, evaluationException);
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -1285,15 +1286,15 @@
</span><span class="cx"> 
</span><span class="cx">         vm.startSampling();
</span><span class="cx"> 
</span><del>-        JSValue evaluationException;
-        JSValue returnValue = evaluate(globalObject-&gt;globalExec(), jscSource(script, fileName), JSValue(), &amp;evaluationException);
</del><ins>+        Exception* evaluationException;
+        JSValue returnValue = evaluate(globalObject-&gt;globalExec(), jscSource(script, fileName), JSValue(), evaluationException);
</ins><span class="cx">         success = success &amp;&amp; !evaluationException;
</span><span class="cx">         if (dump &amp;&amp; !evaluationException)
</span><span class="cx">             printf(&quot;End: %s\n&quot;, returnValue.toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</span><span class="cx">         if (evaluationException) {
</span><del>-            printf(&quot;Exception: %s\n&quot;, evaluationException.toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</del><ins>+            printf(&quot;Exception: %s\n&quot;, evaluationException-&gt;value().toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</ins><span class="cx">             Identifier stackID = Identifier::fromString(globalObject-&gt;globalExec(), &quot;stack&quot;);
</span><del>-            JSValue stackValue = evaluationException.get(globalObject-&gt;globalExec(), stackID);
</del><ins>+            JSValue stackValue = evaluationException-&gt;value().get(globalObject-&gt;globalExec(), stackID);
</ins><span class="cx">             if (!stackValue.isUndefinedOrNull())
</span><span class="cx">                 printf(&quot;%s\n&quot;, stackValue.toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</span><span class="cx">         }
</span><span class="lines">@@ -1349,8 +1350,8 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         
</span><del>-        JSValue evaluationException;
-        JSValue returnValue = evaluate(globalObject-&gt;globalExec(), makeSource(source, interpreterName), JSValue(), &amp;evaluationException);
</del><ins>+        Exception* evaluationException;
+        JSValue returnValue = evaluate(globalObject-&gt;globalExec(), makeSource(source, interpreterName), JSValue(), evaluationException);
</ins><span class="cx"> #else
</span><span class="cx">         printf(&quot;%s&quot;, interactivePrompt);
</span><span class="cx">         Vector&lt;char, 256&gt; line;
</span><span class="lines">@@ -1365,11 +1366,11 @@
</span><span class="cx">             break;
</span><span class="cx">         line.append('\0');
</span><span class="cx"> 
</span><del>-        JSValue evaluationException;
-        JSValue returnValue = evaluate(globalObject-&gt;globalExec(), jscSource(line.data(), interpreterName), JSValue(), &amp;evaluationException);
</del><ins>+        Exception* evaluationException;
+        JSValue returnValue = evaluate(globalObject-&gt;globalExec(), jscSource(line.data(), interpreterName), JSValue(), evaluationException);
</ins><span class="cx"> #endif
</span><span class="cx">         if (evaluationException)
</span><del>-            printf(&quot;Exception: %s\n&quot;, evaluationException.toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</del><ins>+            printf(&quot;Exception: %s\n&quot;, evaluationException-&gt;value().toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</ins><span class="cx">         else
</span><span class="cx">             printf(&quot;%s\n&quot;, returnValue.toString(globalObject-&gt;globalExec())-&gt;value(globalObject-&gt;globalExec()).utf8().data());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;CommonSlowPaths.h&quot;
</span><span class="cx"> #include &quot;Debugger.h&quot;
</span><span class="cx"> #include &quot;DirectArguments.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;Executable.h&quot;
</span><span class="cx"> #include &quot;Heap.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1375,8 +1375,7 @@
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_handle_exception)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN_NO_SET_PC();
</span><del>-    ASSERT(vm.exception());
-    genericUnwind(&amp;vm, exec, vm.exception());
</del><ins>+    genericUnwind(&amp;vm, exec);
</ins><span class="cx">     LLINT_END_IMPL();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -693,7 +693,7 @@
</span><span class="cx">     loadp Callee + PayloadOffset[cfr], t3
</span><span class="cx">     andp MarkedBlockMask, t3
</span><span class="cx">     loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
</span><del>-    bieq VM::m_exception + TagOffset[t3], EmptyValueTag, .noException
</del><ins>+    btiz VM::m_exception[t3], .noException
</ins><span class="cx">     jmp label
</span><span class="cx"> .noException:
</span><span class="cx"> end
</span><span class="lines">@@ -1952,15 +1952,20 @@
</span><span class="cx">     restoreStackPointerAfterCall()
</span><span class="cx"> 
</span><span class="cx">     loadi VM::targetInterpreterPCForThrow[t3], PC
</span><del>-    loadi VM::m_exception + PayloadOffset[t3], t0
-    loadi VM::m_exception + TagOffset[t3], t1
-    storei 0, VM::m_exception + PayloadOffset[t3]
-    storei EmptyValueTag, VM::m_exception + TagOffset[t3]
</del><ins>+    loadi VM::m_exception[t3], t0
+    storei 0, VM::m_exception[t3]
</ins><span class="cx">     loadi 4[PC], t2
</span><span class="cx">     storei t0, PayloadOffset[cfr, t2, 8]
</span><ins>+    storei CellTag, TagOffset[cfr, t2, 8]
+
+    loadi Exception::m_value + TagOffset[t0], t1
+    loadi Exception::m_value + PayloadOffset[t0], t0
+    loadi 8[PC], t2
+    storei t0, PayloadOffset[cfr, t2, 8]
</ins><span class="cx">     storei t1, TagOffset[cfr, t2, 8]
</span><ins>+
</ins><span class="cx">     traceExecution()  # This needs to be here because we don't want to clobber t0, t1, t2, t3 above.
</span><del>-    dispatch(2)
</del><ins>+    dispatch(3)
</ins><span class="cx"> 
</span><span class="cx"> _llint_op_end:
</span><span class="cx">     traceExecution()
</span><span class="lines">@@ -2038,7 +2043,7 @@
</span><span class="cx">     end
</span><span class="cx">     
</span><span class="cx">     functionEpilogue()
</span><del>-    bineq VM::m_exception + TagOffset[t3], EmptyValueTag, .handleException
</del><ins>+    btinz VM::m_exception[t3], .handleException
</ins><span class="cx">     ret
</span><span class="cx"> 
</span><span class="cx"> .handleException:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1820,12 +1820,18 @@
</span><span class="cx">     loadp VM::targetInterpreterPCForThrow[t3], PC
</span><span class="cx">     subp PB, PC
</span><span class="cx">     rshiftp 3, PC
</span><ins>+
</ins><span class="cx">     loadq VM::m_exception[t3], t0
</span><span class="cx">     storeq 0, VM::m_exception[t3]
</span><span class="cx">     loadisFromInstruction(1, t2)
</span><span class="cx">     storeq t0, [cfr, t2, 8]
</span><ins>+
+    loadq Exception::m_value[t0], t3
+    loadisFromInstruction(2, t2)
+    storeq t3, [cfr, t2, 8]
+
</ins><span class="cx">     traceExecution()
</span><del>-    dispatch(2)
</del><ins>+    dispatch(3)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> _llint_op_end:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodeConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/NodeConstructors.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/NodeConstructors.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/parser/NodeConstructors.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -811,10 +811,10 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    inline TryNode::TryNode(const JSTokenLocation&amp; location, StatementNode* tryBlock, const Identifier&amp; exceptionIdent, StatementNode* catchBlock, StatementNode* finallyBlock)
</del><ins>+    inline TryNode::TryNode(const JSTokenLocation&amp; location, StatementNode* tryBlock, const Identifier&amp; thrownValueIdent, StatementNode* catchBlock, StatementNode* finallyBlock)
</ins><span class="cx">         : StatementNode(location)
</span><span class="cx">         , m_tryBlock(tryBlock)
</span><del>-        , m_exceptionIdent(exceptionIdent)
</del><ins>+        , m_thrownValueIdent(thrownValueIdent)
</ins><span class="cx">         , m_catchBlock(catchBlock)
</span><span class="cx">         , m_finallyBlock(finallyBlock)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1511,7 +1511,7 @@
</span><span class="cx">         virtual void emitBytecode(BytecodeGenerator&amp;, RegisterID* = 0) override;
</span><span class="cx"> 
</span><span class="cx">         StatementNode* m_tryBlock;
</span><del>-        const Identifier&amp; m_exceptionIdent;
</del><ins>+        const Identifier&amp; m_thrownValueIdent;
</ins><span class="cx">         StatementNode* m_catchBlock;
</span><span class="cx">         StatementNode* m_finallyBlock;
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCallDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CallData.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CallData.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/CallData.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;CallData.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;Executable.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;JSFunction.h&quot;
</span><span class="lines">@@ -39,15 +40,15 @@
</span><span class="cx">     return exec-&gt;interpreter()-&gt;executeCall(exec, asObject(functionObject), callType, callData, thisValue, args);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData&amp; callData, JSValue thisValue, const ArgList&amp; args, JSValue* exception)
</del><ins>+JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData&amp; callData, JSValue thisValue, const ArgList&amp; args, Exception*&amp; returnedException)
</ins><span class="cx"> {
</span><span class="cx">     JSValue result = call(exec, functionObject, callType, callData, thisValue, args);
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><del>-        if (exception)
-            *exception = exec-&gt;exception();
</del><ins>+        returnedException = exec-&gt;exception();
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx">         return jsUndefined();
</span><del>-    }
</del><ins>+    } else
+        returnedException = nullptr;
</ins><span class="cx">     RELEASE_ASSERT(result);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCallDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CallData.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CallData.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/CallData.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> class ArgList;
</span><ins>+class Exception;
</ins><span class="cx"> class ExecState;
</span><span class="cx"> class FunctionExecutable;
</span><span class="cx"> class JSObject;
</span><span class="lines">@@ -58,7 +59,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> JS_EXPORT_PRIVATE JSValue call(ExecState*, JSValue functionObject, CallType, const CallData&amp;, JSValue thisValue, const ArgList&amp;);
</span><del>-JS_EXPORT_PRIVATE JSValue call(ExecState*, JSValue functionObject, CallType, const CallData&amp;, JSValue thisValue, const ArgList&amp;, JSValue* exception);
</del><ins>+JS_EXPORT_PRIVATE JSValue call(ExecState*, JSValue functionObject, CallType, const CallData&amp;, JSValue thisValue, const ArgList&amp;, Exception*&amp; returnedException);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCompletioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Completion.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Completion.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/Completion.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><span class="cx"> #include &quot;CodeProfiling.h&quot;
</span><span class="cx"> #include &quot;Debugger.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="cx"> #include &quot;JSLock.h&quot;
</span><span class="lines">@@ -60,19 +61,18 @@
</span><span class="cx">         JSParserStrictMode::NotStrict, JSParserCodeType::Program, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue evaluate(ExecState* exec, const SourceCode&amp; source, JSValue thisValue, JSValue* returnedException)
</del><ins>+JSValue evaluate(ExecState* exec, const SourceCode&amp; source, JSValue thisValue, Exception*&amp; returnedException)
</ins><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(exec);
</span><span class="cx">     RELEASE_ASSERT(exec-&gt;vm().atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="cx">     RELEASE_ASSERT(!exec-&gt;vm().isCollectorBusy());
</span><ins>+    returnedException = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     CodeProfiling profile(source);
</span><span class="cx"> 
</span><span class="cx">     ProgramExecutable* program = ProgramExecutable::create(exec, source);
</span><span class="cx">     if (!program) {
</span><del>-        if (returnedException)
-            *returnedException = exec-&gt;vm().exception();
-
</del><ins>+        returnedException = exec-&gt;vm().exception();
</ins><span class="cx">         exec-&gt;vm().clearException();
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="lines">@@ -83,9 +83,7 @@
</span><span class="cx">     JSValue result = exec-&gt;interpreter()-&gt;execute(program, exec, thisObj);
</span><span class="cx"> 
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><del>-        if (returnedException)
-            *returnedException = exec-&gt;exception();
-
</del><ins>+        returnedException = exec-&gt;exception();
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCompletionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Completion.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Completion.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/Completion.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -26,7 +26,8 @@
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><del>-    
</del><ins>+
+class Exception;
</ins><span class="cx"> class ExecState;
</span><span class="cx"> class JSScope;
</span><span class="cx"> class ParserError;
</span><span class="lines">@@ -35,7 +36,12 @@
</span><span class="cx"> 
</span><span class="cx"> JS_EXPORT_PRIVATE bool checkSyntax(VM&amp;, const SourceCode&amp;, ParserError&amp;);
</span><span class="cx"> JS_EXPORT_PRIVATE bool checkSyntax(ExecState*, const SourceCode&amp;, JSValue* exception = 0);
</span><del>-JS_EXPORT_PRIVATE JSValue evaluate(ExecState*, const SourceCode&amp;, JSValue thisValue = JSValue(), JSValue* exception = 0);
</del><ins>+JS_EXPORT_PRIVATE JSValue evaluate(ExecState*, const SourceCode&amp;, JSValue thisValue, Exception*&amp; returnedException);
+inline JSValue evaluate(ExecState* exec, const SourceCode&amp; sourceCode, JSValue thisValue = JSValue())
+{
+    Exception* unused;
+    return evaluate(exec, sourceCode, thisValue, unused);
+}
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Error.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Error.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/Error.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx"> JS_EXPORT_PRIVATE JSObject* throwSyntaxError(ExecState*);
</span><span class="cx"> 
</span><span class="cx"> // Convenience wrappers, wrap result as an EncodedJSValue.
</span><ins>+inline void throwVMError(ExecState* exec, Exception* exception) { exec-&gt;vm().throwException(exec, exception); }
</ins><span class="cx"> inline EncodedJSValue throwVMError(ExecState* exec, JSValue error) { return JSValue::encode(exec-&gt;vm().throwException(exec, error)); }
</span><span class="cx"> inline EncodedJSValue throwVMTypeError(ExecState* exec) { return JSValue::encode(throwTypeError(exec)); }
</span><span class="cx"> inline EncodedJSValue throwVMTypeError(ExecState* exec, const String&amp; errorMessage) { return JSValue::encode(throwTypeError(exec, errorMessage)); }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptioncpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/Exception.cpp (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Exception.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/Exception.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Exception.h&quot;
+
+#include &quot;JSCInlines.h&quot;
+
+namespace JSC {
+
+const ClassInfo Exception::s_info = { &quot;Exception&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(Exception) };
+
+Exception* Exception::create(VM&amp; vm, JSValue thrownValue)
+{
+    Exception* result = new (NotNull, allocateCell&lt;Exception&gt;(vm.heap)) Exception(vm);
+    result-&gt;finishCreation(vm, thrownValue);
+    return result;
+}
+
+void Exception::destroy(JSCell* cell)
+{
+    Exception* exception = static_cast&lt;Exception*&gt;(cell);
+    exception-&gt;~Exception();
+}
+
+Structure* Exception::createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
+{
+    return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+}
+
+void Exception::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
+{
+    Exception* thisObject = jsCast&lt;Exception*&gt;(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+
+    visitor.append(&amp;thisObject-&gt;m_value);
+}
+
+Exception::Exception(VM&amp; vm)
+    : Base(vm, vm.exceptionStructure.get())
+{
+}
+
+Exception::~Exception()
+{
+}
+
+void Exception::finishCreation(VM&amp; vm, JSValue thrownValue)
+{
+    Base::finishCreation(vm);
+
+    m_value.set(vm, this, thrownValue);
+
+    Vector&lt;StackFrame&gt; stackTrace;
+    vm.interpreter-&gt;getStackTrace(stackTrace);
+    m_stack = RefCountedArray&lt;StackFrame&gt;(stackTrace);
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/Exception.h (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Exception.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/Exception.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Exception_h
+#define Exception_h
+
+#include &quot;Interpreter.h&quot;
+#include &lt;wtf/RefCountedArray.h&gt;
+
+namespace JSC {
+    
+class Exception : public JSNonFinalObject {
+public:
+    typedef JSNonFinalObject Base;
+    static const unsigned StructureFlags = StructureIsImmortal | Base::StructureFlags;
+
+    static Exception* create(VM&amp;, JSValue thrownValue);
+
+    static const bool needsDestruction = true;
+    static void destroy(JSCell*);
+
+    static Structure* createStructure(VM&amp;, JSGlobalObject*, JSValue prototype);
+
+    static void visitChildren(JSCell*, SlotVisitor&amp;);
+
+    DECLARE_EXPORT_INFO;
+
+    static ptrdiff_t valueOffset()
+    {
+        return OBJECT_OFFSETOF(Exception, m_value);
+    }
+
+    static Exception* cast(JSValue exceptionAsJSValue)
+    {
+        return jsCast&lt;Exception*&gt;(exceptionAsJSValue.asCell());
+    }
+
+    JSValue value() const { return m_value.get(); }
+    const RefCountedArray&lt;StackFrame&gt;&amp; stack() const { return m_stack; }
+
+    bool didNotifyInspectorOfThrow() const { return m_didNotifyInspectorOfThrow; }
+    void setDidNotifyInspectorOfThrow() { m_didNotifyInspectorOfThrow = true; }
+
+    ~Exception();
+
+private:
+    Exception(VM&amp;);
+    void finishCreation(VM&amp;, JSValue thrownValue);
+
+    WriteBarrier&lt;Unknown&gt; m_value;
+    RefCountedArray&lt;StackFrame&gt; m_stack;
+    bool m_didNotifyInspectorOfThrow { false };
+
+    friend class LLIntOffsetsExtractor;
+};
+
+} // namespace JSC
+
+#endif // Exception_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><span class="cx"> #include &quot;ErrorHandlingScope.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSGlobalObjectFunctions.h&quot;
</span><span class="cx"> #include &quot;JSNotAnObject.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="lines">@@ -59,17 +60,11 @@
</span><span class="cx">     return TerminatedExecutionError::create(*vm);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool isTerminatedExecutionException(JSObject* object)
</del><ins>+bool isTerminatedExecutionException(Exception* exception)
</ins><span class="cx"> {
</span><del>-    return object-&gt;inherits(TerminatedExecutionError::info());
</del><ins>+    return exception-&gt;value().inherits(TerminatedExecutionError::info());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool isTerminatedExecutionException(JSValue value)
-{
-    return value.inherits(TerminatedExecutionError::info());
-}
-
-
</del><span class="cx"> JSObject* createStackOverflowError(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     return createRangeError(exec, ASCIILiteral(&quot;Maximum call stack size exceeded.&quot;));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -37,8 +37,7 @@
</span><span class="cx"> typedef JSObject* (*ErrorFactory)(ExecState*, const String&amp;, ErrorInstance::SourceAppender);
</span><span class="cx"> 
</span><span class="cx"> JSObject* createTerminatedExecutionException(VM*);
</span><del>-bool isTerminatedExecutionException(JSObject*);
-JS_EXPORT_PRIVATE bool isTerminatedExecutionException(JSValue);
</del><ins>+JS_EXPORT_PRIVATE bool isTerminatedExecutionException(Exception*);
</ins><span class="cx"> JS_EXPORT_PRIVATE JSObject* createError(ExecState*, JSValue, const String&amp;, ErrorInstance::SourceAppender);
</span><span class="cx"> JS_EXPORT_PRIVATE JSObject* createStackOverflowError(ExecState*);
</span><span class="cx"> JSObject* createUndefinedVariableError(ExecState*, const Identifier&amp;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGetterSettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;GetterSetter.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Error.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="lines">@@ -75,7 +76,7 @@
</span><span class="cx">     // FIXME: Some callers may invoke get() without checking for an exception first.
</span><span class="cx">     // We work around that by checking here.
</span><span class="cx">     if (exec-&gt;hadException())
</span><del>-        return exec-&gt;exception();
</del><ins>+        return exec-&gt;exception()-&gt;value();
</ins><span class="cx"> 
</span><span class="cx">     JSObject* getter = jsCast&lt;GetterSetter*&gt;(getterSetter)-&gt;getter();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIteratorOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> 
</span><span class="cx"> void iteratorClose(ExecState* exec, JSValue iterator)
</span><span class="cx"> {
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception = nullptr;
</ins><span class="cx">     if (exec-&gt;hadException()) {
</span><span class="cx">         exception = exec-&gt;exception();
</span><span class="cx">         exec-&gt;clearException();
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (returnFunction.isUndefined()) {
</span><del>-        if (!exception.isEmpty())
</del><ins>+        if (exception)
</ins><span class="cx">             exec-&gt;vm().throwException(exec, exception);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     CallData returnFunctionCallData;
</span><span class="cx">     CallType returnFunctionCallType = getCallData(returnFunction, returnFunctionCallData);
</span><span class="cx">     if (returnFunctionCallType == CallTypeNone) {
</span><del>-        if (!exception.isEmpty())
</del><ins>+        if (exception)
</ins><span class="cx">             exec-&gt;vm().throwException(exec, exception);
</span><span class="cx">         else
</span><span class="cx">             throwTypeError(exec);
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     MarkedArgumentBuffer returnFunctionArguments;
</span><span class="cx">     JSValue innerResult = call(exec, returnFunction, returnFunctionCallType, returnFunctionCallData, iterator, returnFunctionArguments);
</span><span class="cx"> 
</span><del>-    if (!exception.isEmpty()) {
</del><ins>+    if (exception) {
</ins><span class="cx">         exec-&gt;vm().throwException(exec, exception);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;CustomGetterSetter.h&quot;
</span><span class="cx"> #include &quot;DatePrototype.h&quot;
</span><span class="cx"> #include &quot;ErrorConstructor.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;Executable.h&quot;
</span><span class="cx"> #include &quot;GetterSetter.h&quot;
</span><span class="cx"> #include &quot;IndexingHeaderInlines.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPromiseConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(PROMISES)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Error.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;IteratorOperations.h&quot;
</span><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><span class="cx"> #include &quot;JSCellInlines.h&quot;
</span><span class="lines">@@ -136,7 +137,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 14. If result is an abrupt completion, call PromiseReject(promise, result.[[value]]).
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><del>-        JSValue exception = exec-&gt;exception();
</del><ins>+        JSValue exception = exec-&gt;exception()-&gt;value();
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx"> 
</span><span class="cx">         promise-&gt;reject(vm, exception);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPromiseDeferredcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPromiseDeferred.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPromiseDeferred.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/JSPromiseDeferred.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(PROMISES)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Error.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><span class="cx"> #include &quot;JSCellInlines.h&quot;
</span><span class="cx"> #include &quot;JSPromise.h&quot;
</span><span class="lines">@@ -150,7 +151,7 @@
</span><span class="cx">         // i. Let 'rejectResult' be the result of calling the [[Call]] internal method of
</span><span class="cx">         //    deferred.[[Reject]] with undefined as thisArgument and a List containing
</span><span class="cx">         //    then.[[value]] as argumentsList.
</span><del>-        JSValue exception = exec-&gt;exception();
</del><ins>+        JSValue exception = exec-&gt;exception()-&gt;value();
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx"> 
</span><span class="cx">         performDeferredReject(exec, deferred, exception);
</span><span class="lines">@@ -185,7 +186,7 @@
</span><span class="cx">         // i. Let 'rejectResult' be the result of calling the [[Call]] internal method of
</span><span class="cx">         //    deferred.[[Reject]] with undefined as thisArgument and a List containing
</span><span class="cx">         //    thenCallResult.[[value]] as argumentsList.
</span><del>-        JSValue exception = exec-&gt;exception();
</del><ins>+        JSValue exception = exec-&gt;exception()-&gt;value();
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx"> 
</span><span class="cx">         performDeferredReject(exec, deferred, exception);
</span><span class="lines">@@ -228,7 +229,7 @@
</span><span class="cx"> JSValue abruptRejection(ExecState* exec, JSPromiseDeferred* deferred)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(exec-&gt;hadException());
</span><del>-    JSValue argument = exec-&gt;exception();
</del><ins>+    JSValue argument = exec-&gt;exception()-&gt;value();
</ins><span class="cx">     exec-&gt;clearException();
</span><span class="cx"> 
</span><span class="cx">     // i. Let 'rejectResult' be the result of calling the [[Call]] internal method
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPromiseReactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPromiseReaction.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPromiseReaction.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/JSPromiseReaction.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(PROMISES)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Error.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><span class="cx"> #include &quot;JSCellInlines.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="lines">@@ -88,7 +89,7 @@
</span><span class="cx">     //    [[Call]] internal method of deferred.[[Reject]] passing undefined as thisArgument
</span><span class="cx">     //    and a List containing handlerResult.[[value]] as argumentsList.
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><del>-        JSValue exception = exec-&gt;exception();
</del><ins>+        JSValue exception = exec-&gt;exception()-&gt;value();
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx"> 
</span><span class="cx">         performDeferredReject(exec, deferred, exception);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;DFGWorklist.h&quot;
</span><span class="cx"> #include &quot;Disassembler.h&quot;
</span><span class="cx"> #include &quot;ErrorInstance.h&quot;
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;FTLThunks.h&quot;
</span><span class="cx"> #include &quot;FunctionConstructor.h&quot;
</span><span class="cx"> #include &quot;GCActivityCallback.h&quot;
</span><span class="lines">@@ -235,6 +236,7 @@
</span><span class="cx">     weakMapDataStructure.set(*this, WeakMapData::createStructure(*this, 0, jsNull()));
</span><span class="cx">     inferredValueStructure.set(*this, InferredValue::createStructure(*this, 0, jsNull()));
</span><span class="cx">     functionRareDataStructure.set(*this, FunctionRareData::createStructure(*this, 0, jsNull()));
</span><ins>+    exceptionStructure.set(*this, Exception::createStructure(*this, 0, jsNull()));
</ins><span class="cx"> #if ENABLE(PROMISES)
</span><span class="cx">     promiseDeferredStructure.set(*this, JSPromiseDeferred::createStructure(*this, 0, jsNull()));
</span><span class="cx">     promiseReactionStructure.set(*this, JSPromiseReaction::createStructure(*this, 0, jsNull()));
</span><span class="lines">@@ -545,7 +547,7 @@
</span><span class="cx">     heap.collectAllGarbage();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue VM::throwException(ExecState* exec, JSValue error)
</del><ins>+void VM::throwException(ExecState* exec, Exception* exception)
</ins><span class="cx"> {
</span><span class="cx">     if (Options::breakOnThrow()) {
</span><span class="cx">         dataLog(&quot;In call frame &quot;, RawPointer(exec), &quot; for code block &quot;, *exec-&gt;codeBlock(), &quot;\n&quot;);
</span><span class="lines">@@ -553,39 +555,24 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     ASSERT(exec == topCallFrame || exec == exec-&gt;lexicalGlobalObject()-&gt;globalExec() || exec == exec-&gt;vmEntryGlobalObject()-&gt;globalExec());
</span><del>-    
-    Vector&lt;StackFrame&gt; stackTrace;
-    interpreter-&gt;getStackTrace(stackTrace);
-    m_exceptionStack = RefCountedArray&lt;StackFrame&gt;(stackTrace);
-    m_exception = error;
</del><ins>+    setException(exception);
+}
</ins><span class="cx"> 
</span><del>-    return error;
</del><ins>+JSValue VM::throwException(ExecState* exec, JSValue thrownValue)
+{
+    Exception* exception = jsDynamicCast&lt;Exception*&gt;(thrownValue);
+    if (!exception)
+        exception = Exception::create(*this, thrownValue);
+
+    throwException(exec, exception);
+    return JSValue(exception);
</ins><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> JSObject* VM::throwException(ExecState* exec, JSObject* error)
</span><span class="cx"> {
</span><span class="cx">     return asObject(throwException(exec, JSValue(error)));
</span><span class="cx"> }
</span><del>-void VM::getExceptionInfo(JSValue&amp; exception, RefCountedArray&lt;StackFrame&gt;&amp; exceptionStack)
-{
-    exception = m_exception;
-    exceptionStack = m_exceptionStack;
-}
-void VM::setExceptionInfo(JSValue&amp; exception, RefCountedArray&lt;StackFrame&gt;&amp; exceptionStack)
-{
-    m_exception = exception;
-    m_exceptionStack = exceptionStack;
-}
</del><span class="cx"> 
</span><del>-void VM::clearException()
-{
-    m_exception = JSValue();
-}
-void VM:: clearExceptionStack()
-{
-    m_exceptionStack = RefCountedArray&lt;StackFrame&gt;();
-}
-
</del><span class="cx"> void VM::setStackPointerAtVMEntry(void* sp)
</span><span class="cx"> {
</span><span class="cx">     m_stackPointerAtVMEntry = sp;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -58,7 +58,6 @@
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><del>-#include &lt;wtf/RefCountedArray.h&gt;
</del><span class="cx"> #include &lt;wtf/SimpleStats.h&gt;
</span><span class="cx"> #include &lt;wtf/StackBounds.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="lines">@@ -78,6 +77,7 @@
</span><span class="cx"> class CodeCache;
</span><span class="cx"> class CommonIdentifiers;
</span><span class="cx"> class ExecState;
</span><ins>+class Exception;
</ins><span class="cx"> class HandleStack;
</span><span class="cx"> class TypeProfiler;
</span><span class="cx"> class TypeProfilerLog;
</span><span class="lines">@@ -274,6 +274,7 @@
</span><span class="cx">     Strong&lt;Structure&gt; weakMapDataStructure;
</span><span class="cx">     Strong&lt;Structure&gt; inferredValueStructure;
</span><span class="cx">     Strong&lt;Structure&gt; functionRareDataStructure;
</span><ins>+    Strong&lt;Structure&gt; exceptionStructure;
</ins><span class="cx"> #if ENABLE(PROMISES)
</span><span class="cx">     Strong&lt;Structure&gt; promiseDeferredStructure;
</span><span class="cx">     Strong&lt;Structure&gt; promiseReactionStructure;
</span><span class="lines">@@ -372,14 +373,13 @@
</span><span class="cx">         return OBJECT_OFFSETOF(VM, targetMachinePCForThrow);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JS_EXPORT_PRIVATE void clearException();
-    JS_EXPORT_PRIVATE void clearExceptionStack();
-    void getExceptionInfo(JSValue&amp; exception, RefCountedArray&lt;StackFrame&gt;&amp; exceptionStack);
-    void setExceptionInfo(JSValue&amp; exception, RefCountedArray&lt;StackFrame&gt;&amp; exceptionStack);
-    JSValue exception() const { return m_exception; }
-    JSValue* addressOfException() { return &amp;m_exception; }
-    const RefCountedArray&lt;StackFrame&gt;&amp; exceptionStack() const { return m_exceptionStack; }
</del><ins>+    void clearException() { m_exception = nullptr; }
+    void setException(Exception* exception) { m_exception = exception; }
</ins><span class="cx"> 
</span><ins>+    Exception* exception() const { return m_exception; }
+    JSCell** addressOfException() { return reinterpret_cast&lt;JSCell**&gt;(&amp;m_exception); }
+
+    JS_EXPORT_PRIVATE void throwException(ExecState*, Exception*);
</ins><span class="cx">     JS_EXPORT_PRIVATE JSValue throwException(ExecState*, JSValue);
</span><span class="cx">     JS_EXPORT_PRIVATE JSObject* throwException(ExecState*, JSObject*);
</span><span class="cx"> 
</span><span class="lines">@@ -569,12 +569,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx">     void* m_lastStackTop;
</span><del>-    JSValue m_exception;
</del><ins>+    Exception* m_exception { nullptr };
</ins><span class="cx">     bool m_inDefineOwnProperty;
</span><span class="cx">     std::unique_ptr&lt;CodeCache&gt; m_codeCache;
</span><span class="cx">     LegacyProfiler* m_enabledProfiler;
</span><span class="cx">     std::unique_ptr&lt;BuiltinExecutables&gt; m_builtinExecutables;
</span><del>-    RefCountedArray&lt;StackFrame&gt; m_exceptionStack;
</del><span class="cx">     HashMap&lt;String, RefPtr&lt;WatchpointSet&gt;&gt; m_impurePropertyWatchpointSets;
</span><span class="cx">     std::unique_ptr&lt;TypeProfiler&gt; m_typeProfiler;
</span><span class="cx">     std::unique_ptr&lt;TypeProfilerLog&gt; m_typeProfilerLog;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMEntryScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -49,9 +49,6 @@
</span><span class="cx">         // observe time xone changes.
</span><span class="cx">         vm.resetDateCache();
</span><span class="cx">     }
</span><del>-
-    // Clear the captured exception stack between entries
-    vm.clearExceptionStack();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VMEntryScope::setEntryScopeDidPopListener(void* key, EntryScopeDidPopListener listener)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/ChangeLog        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2015-06-05  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        finally blocks should not set the exception stack trace when re-throwing the exception.
+        https://bugs.webkit.org/show_bug.cgi?id=145525
+
+        Reviewed by Geoffrey Garen.
+
+        Update to use the new JSC::Exception object.
+
+        Test: inspector/debugger/break-on-exceptions.html
+
+        * ForwardingHeaders/runtime/Exception.h: Added.
+        * bindings/js/JSCallbackData.cpp:
+        (WebCore::JSCallbackData::invokeCallback):
+        * bindings/js/JSCustomXPathNSResolver.cpp:
+        (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::jsArray):
+        (WebCore::reportException):
+        (WebCore::reportCurrentException):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSErrorHandler.cpp:
+        (WebCore::JSErrorHandler::handleEvent):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSMainThreadExecState.cpp:
+        (WebCore::JSMainThreadExecState::didLeaveScriptContext):
+        (WebCore::functionCallHandlerFromAnyThread):
+        (WebCore::evaluateHandlerFromAnyThread):
+        * bindings/js/JSMainThreadExecState.h:
+        (WebCore::JSMainThreadExecState::currentState):
+        (WebCore::JSMainThreadExecState::call):
+        (WebCore::JSMainThreadExecState::evaluate):
+        (WebCore::JSMainThreadExecState::runTask):
+
+        * bindings/js/JSMediaDevicesCustom.cpp:
+        (WebCore::JSMediaDevices::getUserMedia):
+        - Fixed a bug where the exception was not cleared before entering the VM to
+          call JS code.
+
+        * bindings/js/JSMutationCallback.cpp:
+        (WebCore::JSMutationCallback::call):
+        * bindings/js/ReadableJSStream.cpp:
+        (WebCore::getPropertyFromObject):
+        (WebCore::callFunction):
+        (WebCore::ReadableJSStream::Source::start):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::executeFunctionInContext):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInWorld):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::create):
+        (WebCore::SerializedScriptValue::deserialize):
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::evaluate):
+        (WebCore::WorkerScriptController::setException):
+        (WebCore::WorkerScriptController::scheduleExecutionTermination):
+        * bindings/js/WorkerScriptController.h:
+        (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
+        * bindings/js/WorkerScriptDebugServer.cpp:
+        (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
+        (WebCore::WorkerScriptDebugServer::reportException):
+        * bindings/js/WorkerScriptDebugServer.h:
+        * bindings/objc/WebScriptObject.mm:
+        (WebCore::createJSWrapper):
+        (WebCore::addExceptionToConsole):
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject evaluateWebScript:]):
+        - Changed to call a version of JSMainThreadExecState::evaluate() that provides
+          a stub returnedException because evaluateWebScript: doesn't need the exception.
+
+        * inspector/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::isContentScript):
+        (WebCore::PageScriptDebugServer::reportException):
+        * inspector/PageScriptDebugServer.h:
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::importScripts):
+
</ins><span class="cx"> 2015-06-05  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Layout tests fullscreen/video-controls-drag.html and media/video-fullscreeen-only-controls.html
</span></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersruntimeExceptionh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/runtime/Exception.h (0 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/runtime/Exception.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/runtime/Exception.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_Exception_h
+#define WebCore_FWD_Exception_h
+#include &lt;JavaScriptCore/Exception.h&gt;
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCallbackDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCallbackData.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCallbackData.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSCallbackData.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -73,10 +73,10 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData);
</span><span class="cx"> 
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception;
</ins><span class="cx">     JSValue result = context-&gt;isDocument()
</span><del>-        ? JSMainThreadExecState::call(exec, function, callType, callData, thisValue, args, &amp;exception)
-        : JSC::call(exec, function, callType, callData, thisValue, args, &amp;exception);
</del><ins>+        ? JSMainThreadExecState::call(exec, function, callType, callData, thisValue, args, exception)
+        : JSC::call(exec, function, callType, callData, thisValue, args, exception);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomXPathNSResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -93,8 +93,8 @@
</span><span class="cx">     MarkedArgumentBuffer args;
</span><span class="cx">     args.append(jsStringWithCache(exec, prefix));
</span><span class="cx"> 
</span><del>-    JSValue exception;
-    JSValue retval = JSMainThreadExecState::call(exec, function, callType, callData, m_customResolver.get(), args, &amp;exception);
</del><ins>+    Exception* exception;
+    JSValue retval = JSMainThreadExecState::call(exec, function, callType, callData, m_customResolver.get(), args, exception);
</ins><span class="cx"> 
</span><span class="cx">     String result;
</span><span class="cx">     if (exception)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &lt;runtime/DateInstance.h&gt;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/ErrorHandlingScope.h&gt;
</span><ins>+#include &lt;runtime/Exception.h&gt;
</ins><span class="cx"> #include &lt;runtime/ExceptionHelpers.h&gt;
</span><span class="cx"> #include &lt;runtime/JSFunction.h&gt;
</span><span class="cx"> #include &lt;stdarg.h&gt;
</span><span class="lines">@@ -138,7 +139,7 @@
</span><span class="cx">     return JSC::constructArray(exec, 0, globalObject, list);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void reportException(ExecState* exec, JSValue exception, CachedScript* cachedScript)
</del><ins>+void reportException(ExecState* exec, Exception* exception, CachedScript* cachedScript)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(exec-&gt;vm().currentThreadIsHoldingAPILock());
</span><span class="cx">     if (isTerminatedExecutionException(exception))
</span><span class="lines">@@ -148,7 +149,6 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ScriptCallStack&gt; callStack(createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture));
</span><span class="cx">     exec-&gt;clearException();
</span><del>-    exec-&gt;clearSupplementaryExceptionInfo();
</del><span class="cx"> 
</span><span class="cx">     JSDOMGlobalObject* globalObject = jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject());
</span><span class="cx">     if (JSDOMWindow* window = jsDynamicCast&lt;JSDOMWindow*&gt;(globalObject)) {
</span><span class="lines">@@ -166,14 +166,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String errorMessage;
</span><del>-    if (ExceptionBase* exceptionBase = toExceptionBase(exception))
</del><ins>+    if (ExceptionBase* exceptionBase = toExceptionBase(exception-&gt;value()))
</ins><span class="cx">         errorMessage = exceptionBase-&gt;message() + &quot;: &quot;  + exceptionBase-&gt;description();
</span><span class="cx">     else {
</span><span class="cx">         // FIXME: &lt;http://webkit.org/b/115087&gt; Web Inspector: WebCore::reportException should not evaluate JavaScript handling exceptions
</span><span class="cx">         // If this is a custon exception object, call toString on it to try and get a nice string representation for the exception.
</span><del>-        errorMessage = exception.toString(exec)-&gt;value(exec);
</del><ins>+        errorMessage = exception-&gt;value().toString(exec)-&gt;value(exec);
</ins><span class="cx">         exec-&gt;clearException();
</span><del>-        exec-&gt;clearSupplementaryExceptionInfo();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext = globalObject-&gt;scriptExecutionContext();
</span><span class="lines">@@ -182,7 +181,7 @@
</span><span class="cx"> 
</span><span class="cx"> void reportCurrentException(ExecState* exec)
</span><span class="cx"> {
</span><del>-    JSValue exception = exec-&gt;exception();
</del><ins>+    Exception* exception = exec-&gt;exception();
</ins><span class="cx">     exec-&gt;clearException();
</span><span class="cx">     reportException(exec, exception);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx"> 
</span><span class="cx"> const JSC::HashTable&amp; getHashTableForGlobalData(JSC::VM&amp;, const JSC::HashTable&amp; staticTable);
</span><span class="cx"> 
</span><del>-WEBCORE_EXPORT void reportException(JSC::ExecState*, JSC::JSValue exception, CachedScript* = nullptr);
</del><ins>+WEBCORE_EXPORT void reportException(JSC::ExecState*, JSC::Exception*, CachedScript* = nullptr);
</ins><span class="cx"> void reportCurrentException(JSC::ExecState*);
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue createDOMException(JSC::ExecState*, ExceptionCode);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSErrorHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -98,10 +98,10 @@
</span><span class="cx">         VM&amp; vm = globalObject-&gt;vm();
</span><span class="cx">         VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope-&gt;globalObject() : globalObject);
</span><span class="cx"> 
</span><del>-        JSValue exception;
</del><ins>+        Exception* exception;
</ins><span class="cx">         JSValue returnValue = scriptExecutionContext-&gt;isDocument()
</span><del>-            ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, globalObject, args, &amp;exception)
-            : JSC::call(exec, jsFunction, callType, callData, globalObject, args, &amp;exception);
</del><ins>+            ? JSMainThreadExecState::call(exec, jsFunction, callType, callData, globalObject, args, exception)
+            : JSC::call(exec, jsFunction, callType, callData, globalObject, args, exception);
</ins><span class="cx"> 
</span><span class="cx">         globalObject-&gt;setCurrentEvent(savedEvent);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -124,10 +124,10 @@
</span><span class="cx">         InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(scriptExecutionContext, callType, callData);
</span><span class="cx"> 
</span><span class="cx">         JSValue thisValue = handleEventFunction == jsFunction ? toJS(exec, globalObject, event-&gt;currentTarget()) : jsFunction;
</span><del>-        JSValue exception;
</del><ins>+        Exception* exception;
</ins><span class="cx">         JSValue retval = scriptExecutionContext-&gt;isDocument()
</span><del>-            ? JSMainThreadExecState::call(exec, handleEventFunction, callType, callData, thisValue, args, &amp;exception)
-            : JSC::call(exec, handleEventFunction, callType, callData, thisValue, args, &amp;exception);
</del><ins>+            ? JSMainThreadExecState::call(exec, handleEventFunction, callType, callData, thisValue, args, exception)
+            : JSC::call(exec, handleEventFunction, callType, callData, thisValue, args, exception);
</ins><span class="cx"> 
</span><span class="cx">         InspectorInstrumentation::didCallFunction(cookie, scriptExecutionContext);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMainThreadExecStatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -46,18 +46,18 @@
</span><span class="cx">     MutationObserver::deliverAllMutations();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::JSValue* exception)
</del><ins>+JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::Exception*&amp; returnedException)
</ins><span class="cx"> {
</span><span class="cx">     if (isMainThread())
</span><del>-        return JSMainThreadExecState::call(exec, functionObject, callType, callData, thisValue, args, exception);
-    return JSC::call(exec, functionObject, callType, callData, thisValue, args, exception);
</del><ins>+        return JSMainThreadExecState::call(exec, functionObject, callType, callData, thisValue, args, returnedException);
+    return JSC::call(exec, functionObject, callType, callData, thisValue, args, returnedException);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue evaluateHandlerFromAnyThread(JSC::ExecState* exec, const JSC::SourceCode&amp; source, JSC::JSValue thisValue, JSC::JSValue* exception)
</del><ins>+JSC::JSValue evaluateHandlerFromAnyThread(JSC::ExecState* exec, const JSC::SourceCode&amp; source, JSC::JSValue thisValue, JSC::Exception*&amp; returnedException)
</ins><span class="cx"> {
</span><span class="cx">     if (isMainThread())
</span><del>-        return JSMainThreadExecState::evaluate(exec, source, thisValue, exception);
-    return JSC::evaluate(exec, source, thisValue, exception);
</del><ins>+        return JSMainThreadExecState::evaluate(exec, source, thisValue, returnedException);
+    return JSC::evaluate(exec, source, thisValue, returnedException);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMainThreadExecStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -50,18 +50,24 @@
</span><span class="cx">         return s_mainThreadState;
</span><span class="cx">     };
</span><span class="cx">     
</span><del>-    static JSC::JSValue call(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::JSValue* exception)
</del><ins>+    static JSC::JSValue call(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData&amp; callData, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::Exception*&amp; returnedException)
</ins><span class="cx">     {
</span><span class="cx">         JSMainThreadExecState currentState(exec);
</span><del>-        return JSC::call(exec, functionObject, callType, callData, thisValue, args, exception);
</del><ins>+        return JSC::call(exec, functionObject, callType, callData, thisValue, args, returnedException);
</ins><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static JSC::JSValue evaluate(JSC::ExecState* exec, const JSC::SourceCode&amp; source, JSC::JSValue thisValue, JSC::JSValue* exception)
</del><ins>+    static JSC::JSValue evaluate(JSC::ExecState* exec, const JSC::SourceCode&amp; source, JSC::JSValue thisValue, JSC::Exception*&amp; returnedException)
</ins><span class="cx">     {
</span><span class="cx">         JSMainThreadExecState currentState(exec);
</span><del>-        return JSC::evaluate(exec, source, thisValue, exception);
</del><ins>+        return JSC::evaluate(exec, source, thisValue, returnedException);
</ins><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    static JSC::JSValue evaluate(JSC::ExecState* exec, const JSC::SourceCode&amp; source, JSC::JSValue thisValue = JSC::JSValue())
+    {
+        JSC::Exception* unused;
+        return evaluate(exec, source, thisValue, unused);
+    };
+
</ins><span class="cx">     static void runTask(JSC::ExecState* exec, JSC::Microtask&amp; task)
</span><span class="cx">     {
</span><span class="cx">         JSMainThreadExecState currentState(exec);
</span><span class="lines">@@ -121,8 +127,8 @@
</span><span class="cx">     JSC::ExecState* m_previousState;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState*, JSC::JSValue functionObject, JSC::CallType, const JSC::CallData&amp;, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::JSValue* exception);
-JSC::JSValue evaluateHandlerFromAnyThread(JSC::ExecState*, const JSC::SourceCode&amp;, JSC::JSValue thisValue, JSC::JSValue* exception);
</del><ins>+JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState*, JSC::JSValue functionObject, JSC::CallType, const JSC::CallData&amp;, JSC::JSValue thisValue, const JSC::ArgList&amp; args, JSC::Exception*&amp; returnedException);
+JSC::JSValue evaluateHandlerFromAnyThread(JSC::ExecState*, const JSC::SourceCode&amp;, JSC::JSValue thisValue, JSC::Exception*&amp; returnedException);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMediaDevicesCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &quot;JSDOMPromise.h&quot;
</span><span class="cx"> #include &quot;JSMediaStream.h&quot;
</span><span class="cx"> #include &quot;JSNavigatorUserMediaError.h&quot;
</span><ins>+#include &lt;runtime/Exception.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="lines">@@ -50,7 +51,9 @@
</span><span class="cx"> 
</span><span class="cx">     Dictionary options(exec, exec-&gt;argument(0));
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><del>-        wrapper.reject(exec-&gt;exception());
</del><ins>+        Exception* exception = exec-&gt;exception();
+        exec-&gt;clearException();
+        wrapper.reject(exception-&gt;value());
</ins><span class="cx">         return wrapper.promise();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMutationCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData);
</span><span class="cx"> 
</span><del>-    JSValue exception;
-    JSMainThreadExecState::call(exec, callback, callType, callData, jsObserver, args, &amp;exception);
</del><ins>+    Exception* exception;
+    JSMainThreadExecState::call(exec, callback, callType, callData, jsObserver, args, exception);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsReadableJSStreamcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ReadableJSStream.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ReadableJSStream.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/ReadableJSStream.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     return object-&gt;get(exec, Identifier::fromString(exec, identifier));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline JSValue callFunction(ExecState* exec, JSValue jsFunction, JSValue thisValue, const ArgList&amp; arguments, JSValue* exception)
</del><ins>+static inline JSValue callFunction(ExecState* exec, JSValue jsFunction, JSValue thisValue, const ArgList&amp; arguments, Exception*&amp; exception)
</ins><span class="cx"> {
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType = getCallData(jsFunction, callData);
</span><span class="lines">@@ -88,8 +88,8 @@
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(jsController(exec, globalObject()));
</span><span class="cx"> 
</span><del>-    JSValue exception;
-    callFunction(&amp;exec, startFunction, m_source.get(), arguments, &amp;exception);
</del><ins>+    Exception* exception;
+    callFunction(&amp;exec, startFunction, m_source.get(), arguments, exception);
</ins><span class="cx"> 
</span><span class="cx">     if (exception) {
</span><span class="cx">         throwVMError(&amp;exec, exception);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScheduledActioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -99,11 +99,11 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(&amp;context, callType, callData);
</span><span class="cx"> 
</span><del>-    JSValue exception;
</del><ins>+    Exception* exception;
</ins><span class="cx">     if (is&lt;Document&gt;(context))
</span><del>-        JSMainThreadExecState::call(exec, m_function.get(), callType, callData, thisValue, args, &amp;exception);
</del><ins>+        JSMainThreadExecState::call(exec, m_function.get(), callType, callData, thisValue, args, exception);
</ins><span class="cx">     else
</span><del>-        JSC::call(exec, m_function.get(), callType, callData, thisValue, args, &amp;exception);
</del><ins>+        JSC::call(exec, m_function.get(), callType, callData, thisValue, args, exception);
</ins><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, &amp;context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptController.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -160,10 +160,9 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine());
</span><span class="cx"> 
</span><del>-    JSValue evaluationException;
</del><ins>+    Exception* evaluationException;
+    JSValue returnValue = JSMainThreadExecState::evaluate(exec, jsSourceCode, shell, evaluationException);
</ins><span class="cx"> 
</span><del>-    JSValue returnValue = JSMainThreadExecState::evaluate(exec, jsSourceCode, shell, &amp;evaluationException);
-
</del><span class="cx">     InspectorInstrumentation::didEvaluateScript(cookie, m_frame);
</span><span class="cx"> 
</span><span class="cx">     if (evaluationException) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> #include &lt;runtime/BooleanObject.h&gt;
</span><span class="cx"> #include &lt;runtime/DateInstance.h&gt;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><ins>+#include &lt;runtime/Exception.h&gt;
</ins><span class="cx"> #include &lt;runtime/ExceptionHelpers.h&gt;
</span><span class="cx"> #include &lt;runtime/JSArrayBuffer.h&gt;
</span><span class="cx"> #include &lt;runtime/JSArrayBufferView.h&gt;
</span><span class="lines">@@ -2702,7 +2703,7 @@
</span><span class="cx">     RefPtr&lt;SerializedScriptValue&gt; serializedValue = SerializedScriptValue::create(exec, value, nullptr, nullptr);
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><span class="cx">         if (exception)
</span><del>-            *exception = toRef(exec, exec-&gt;exception());
</del><ins>+            *exception = toRef(exec, exec-&gt;exception()-&gt;value());
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="lines">@@ -2732,7 +2733,7 @@
</span><span class="cx">     JSValue value = deserialize(exec, exec-&gt;lexicalGlobalObject(), nullptr);
</span><span class="cx">     if (exec-&gt;hadException()) {
</span><span class="cx">         if (exception)
</span><del>-            *exception = toRef(exec, exec-&gt;exception());
</del><ins>+            *exception = toRef(exec, exec-&gt;exception()-&gt;value());
</ins><span class="cx">         exec-&gt;clearException();
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &lt;heap/StrongInlines.h&gt;
</span><span class="cx"> #include &lt;interpreter/Interpreter.h&gt;
</span><span class="cx"> #include &lt;runtime/Completion.h&gt;
</span><ins>+#include &lt;runtime/Exception.h&gt;
</ins><span class="cx"> #include &lt;runtime/ExceptionHelpers.h&gt;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="lines">@@ -98,15 +99,15 @@
</span><span class="cx">     if (isExecutionForbidden())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Deprecated::ScriptValue exception;
-    evaluate(sourceCode, &amp;exception);
-    if (exception.jsValue()) {
</del><ins>+    Exception* exception;
+    evaluate(sourceCode, exception);
+    if (exception) {
</ins><span class="cx">         JSLockHolder lock(vm());
</span><del>-        reportException(m_workerGlobalScopeWrapper-&gt;globalExec(), exception.jsValue());
</del><ins>+        reportException(m_workerGlobalScopeWrapper-&gt;globalExec(), exception);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerScriptController::evaluate(const ScriptSourceCode&amp; sourceCode, Deprecated::ScriptValue* exception)
</del><ins>+void WorkerScriptController::evaluate(const ScriptSourceCode&amp; sourceCode, JSC::Exception*&amp; returnedException)
</ins><span class="cx"> {
</span><span class="cx">     if (isExecutionForbidden())
</span><span class="cx">         return;
</span><span class="lines">@@ -116,8 +117,8 @@
</span><span class="cx">     ExecState* exec = m_workerGlobalScopeWrapper-&gt;globalExec();
</span><span class="cx">     JSLockHolder lock(exec);
</span><span class="cx"> 
</span><del>-    JSValue evaluationException;
-    JSC::evaluate(exec, sourceCode.jsSourceCode(), m_workerGlobalScopeWrapper-&gt;globalThis(), &amp;evaluationException);
</del><ins>+    JSC::Exception* evaluationException;
+    JSC::evaluate(exec, sourceCode.jsSourceCode(), m_workerGlobalScopeWrapper-&gt;globalThis(), evaluationException);
</ins><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     if ((evaluationException &amp;&amp; isTerminatedExecutionException(evaluationException)) 
</span><span class="lines">@@ -131,16 +132,19 @@
</span><span class="cx">         int lineNumber = 0;
</span><span class="cx">         int columnNumber = 0;
</span><span class="cx">         String sourceURL = sourceCode.url().string();
</span><del>-        if (m_workerGlobalScope-&gt;sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, sourceCode.cachedScript()))
-            *exception = Deprecated::ScriptValue(*m_vm, exec-&gt;vm().throwException(exec, createError(exec, errorMessage.impl())));
-        else
-            *exception = Deprecated::ScriptValue(*m_vm, evaluationException);
</del><ins>+        if (m_workerGlobalScope-&gt;sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, sourceCode.cachedScript())) {
+            vm.throwException(exec, createError(exec, errorMessage.impl()));
+            evaluationException = vm.exception();
+            vm.clearException();
+        }
</ins><span class="cx">     }
</span><ins>+    returnedException = evaluationException;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerScriptController::setException(const Deprecated::ScriptValue&amp; exception)
</del><ins>+void WorkerScriptController::setException(JSC::Exception* exception)
</ins><span class="cx"> {
</span><del>-    m_workerGlobalScopeWrapper-&gt;globalExec()-&gt;vm().throwException(m_workerGlobalScopeWrapper-&gt;globalExec(), exception.jsValue());
</del><ins>+    JSC::ExecState* exec = m_workerGlobalScopeWrapper-&gt;globalExec();
+    exec-&gt;vm().throwException(exec, exception);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WorkerScriptController::scheduleExecutionTermination()
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -60,9 +60,9 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         void evaluate(const ScriptSourceCode&amp;);
</span><del>-        void evaluate(const ScriptSourceCode&amp;, Deprecated::ScriptValue* exception);
</del><ins>+        void evaluate(const ScriptSourceCode&amp;, JSC::Exception*&amp; returnedException);
</ins><span class="cx"> 
</span><del>-        void setException(const Deprecated::ScriptValue&amp;);
</del><ins>+        void setException(JSC::Exception*);
</ins><span class="cx"> 
</span><span class="cx">         // Async request to terminate a JS run execution. Eventually causes termination
</span><span class="cx">         // exception raised during JS execution, if the worker thread happens to run JS.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     } while (result != MessageQueueTerminated &amp;&amp; !m_doneProcessingDebuggerEvents);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WorkerScriptDebugServer::reportException(JSC::ExecState* exec, JSC::JSValue exception) const
</del><ins>+void WorkerScriptDebugServer::reportException(JSC::ExecState* exec, JSC::Exception* exception) const
</ins><span class="cx"> {
</span><span class="cx">     WebCore::reportException(exec, exception);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     virtual void didContinue(JSC::JSGlobalObject*) override { }
</span><span class="cx">     virtual void runEventLoopWhilePaused() override;
</span><span class="cx">     virtual bool isContentScript(JSC::ExecState*) const override { return false; }
</span><del>-    virtual void reportException(JSC::ExecState*, JSC::JSValue) const override;
</del><ins>+    virtual void reportException(JSC::ExecState*, JSC::Exception*) const override;
</ins><span class="cx"> 
</span><span class="cx">     WorkerGlobalScope* m_workerGlobalScope;
</span><span class="cx">     ListenerSet m_listeners;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcWebScriptObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/WebScriptObject.mm (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/WebScriptObject.mm        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/bindings/objc/WebScriptObject.mm        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">     return [[[WebScriptObject alloc] _initWithJSObject:object originRootObject:origin rootObject:root] autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void addExceptionToConsole(ExecState* exec, JSC::JSValue&amp; exception)
</del><ins>+static void addExceptionToConsole(ExecState* exec, JSC::Exception* exception)
</ins><span class="cx"> {
</span><span class="cx">     JSDOMWindow* window = asJSDOMWindow(exec-&gt;vmEntryGlobalObject());
</span><span class="cx">     if (!window || !exception)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void addExceptionToConsole(ExecState* exec)
</span><span class="cx"> {
</span><del>-    JSC::JSValue exception = exec-&gt;exception();
</del><ins>+    JSC::Exception* exception = exec-&gt;exception();
</ins><span class="cx">     exec-&gt;clearException();
</span><span class="cx">     addExceptionToConsole(exec, exception);
</span><span class="cx"> }
</span><span class="lines">@@ -342,8 +342,8 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    JSC::JSValue exception;
-    JSC::JSValue result = JSMainThreadExecState::call(exec, function, callType, callData, [self _imp], argList, &amp;exception);
</del><ins>+    JSC::Exception* exception;
+    JSC::JSValue result = JSMainThreadExecState::call(exec, function, callType, callData, [self _imp], argList, exception);
</ins><span class="cx"> 
</span><span class="cx">     if (exception) {
</span><span class="cx">         addExceptionToConsole(exec, exception);
</span><span class="lines">@@ -366,7 +366,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSLockHolder lock(exec);
</span><span class="cx">     
</span><del>-    JSC::JSValue returnValue = JSMainThreadExecState::evaluate(exec, makeSource(String(script)), JSC::JSValue(), 0);
</del><ins>+    JSC::JSValue returnValue = JSMainThreadExecState::evaluate(exec, makeSource(String(script)), JSC::JSValue());
</ins><span class="cx"> 
</span><span class="cx">     id resultObj = [WebScriptObject _convertValueToObjcValue:returnValue originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     return &amp;currentWorld(exec) != &amp;mainThreadNormalWorld();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageScriptDebugServer::reportException(ExecState* exec, JSValue exception) const
</del><ins>+void PageScriptDebugServer::reportException(ExecState* exec, Exception* exception) const
</ins><span class="cx"> {
</span><span class="cx">     WebCore::reportException(exec, exception);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageScriptDebugServer.h (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageScriptDebugServer.h        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.h        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     virtual void didContinue(JSC::JSGlobalObject*) override;
</span><span class="cx">     virtual void runEventLoopWhilePaused() override;
</span><span class="cx">     virtual bool isContentScript(JSC::ExecState*) const override;
</span><del>-    virtual void reportException(JSC::ExecState*, JSC::JSValue) const override;
</del><ins>+    virtual void reportException(JSC::ExecState*, JSC::Exception*) const override;
</ins><span class="cx"> 
</span><span class="cx">     void runEventLoopWhilePausedInternal();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -197,9 +197,9 @@
</span><span class="cx"> 
</span><span class="cx">         InspectorInstrumentation::scriptImported(scriptExecutionContext(), scriptLoader-&gt;identifier(), scriptLoader-&gt;script());
</span><span class="cx"> 
</span><del>-        Deprecated::ScriptValue exception;
-        m_script-&gt;evaluate(ScriptSourceCode(scriptLoader-&gt;script(), scriptLoader-&gt;responseURL()), &amp;exception);
-        if (!exception.hasNoValue()) {
</del><ins>+        JSC::Exception* exception;
+        m_script-&gt;evaluate(ScriptSourceCode(scriptLoader-&gt;script(), scriptLoader-&gt;responseURL()), exception);
+        if (exception) {
</ins><span class="cx">             m_script-&gt;setException(exception);
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-06-05  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        finally blocks should not set the exception stack trace when re-throwing the exception.
+        https://bugs.webkit.org/show_bug.cgi?id=145525
+
+        Reviewed by Geoffrey Garen.
+
+        * WebView/WebView.mm:
+        (+[WebView _reportException:inContext:]):
+        (WebKitInitializeApplicationCachePathIfNecessary):
+        - Changed to use the new Exception object.
+
</ins><span class="cx"> 2015-06-03  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Define WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS on iOS
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><span class="cx"> #import &lt;CoreFoundation/CFSet.h&gt;
</span><span class="cx"> #import &lt;Foundation/NSURLConnection.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/APICast.h&gt;
</span><ins>+#import &lt;JavaScriptCore/Exception.h&gt;
</ins><span class="cx"> #import &lt;JavaScriptCore/JSValueRef.h&gt;
</span><span class="cx"> #import &lt;WebCore/AlternativeTextUIController.h&gt;
</span><span class="cx"> #import &lt;WebCore/AnimationController.h&gt;
</span><span class="lines">@@ -724,7 +725,8 @@
</span><span class="cx">     if (!toJSDOMWindow(execState-&gt;lexicalGlobalObject()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    reportException(execState, toJS(execState, exception));
</del><ins>+    Exception* vmException = Exception::cast(toJS(execState, exception));
+    reportException(execState, vmException);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void WebKitInitializeApplicationCachePathIfNecessary()
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebKit/win/ChangeLog        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-06-05  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        finally blocks should not set the exception stack trace when re-throwing the exception.
+        https://bugs.webkit.org/show_bug.cgi?id=145525
+
+        Reviewed by Geoffrey Garen.
+
+        * WebView.cpp:
+        (WebView::reportException):
+        - Changed to use the new Exception object.
+
</ins><span class="cx"> 2015-06-02  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> #include &quot;WebVisitedLinkStore.h&quot;
</span><span class="cx"> #include &quot;resource.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/APICast.h&gt;
</span><ins>+#include &lt;JavaScriptCore/Exception.h&gt;
</ins><span class="cx"> #include &lt;JavaScriptCore/InitializeThreading.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSCJSValue.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSLock.h&gt;
</span><span class="lines">@@ -6029,7 +6030,8 @@
</span><span class="cx">     if (!toJSDOMWindow(execState-&gt;lexicalGlobalObject()))
</span><span class="cx">         return E_FAIL;
</span><span class="cx"> 
</span><del>-    WebCore::reportException(execState, toJS(execState, exception));
</del><ins>+    JSC::Exception* vmException = JSC::Exception::cast(toJS(execState, exception));
+    WebCore::reportException(execState, vmException);
</ins><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-06-05  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        finally blocks should not set the exception stack trace when re-throwing the exception.
+        https://bugs.webkit.org/show_bug.cgi?id=145525
+
+        Reviewed by Geoffrey Garen.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::reportException):
+        - Changed to use the new Exception object.
+
</ins><span class="cx"> 2015-06-05  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Disable the CFNetwork cache in the web process
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (185258 => 185259)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2015-06-05 18:39:08 UTC (rev 185258)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2015-06-05 18:52:12 UTC (rev 185259)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> #include &quot;WebProcessCreationParameters.h&quot;
</span><span class="cx"> #include &quot;WebProcessPoolMessages.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/APICast.h&gt;
</span><ins>+#include &lt;JavaScriptCore/Exception.h&gt;
</ins><span class="cx"> #include &lt;JavaScriptCore/JSLock.h&gt;
</span><span class="cx"> #include &lt;WebCore/ApplicationCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/ApplicationCacheStorage.h&gt;
</span><span class="lines">@@ -522,7 +523,7 @@
</span><span class="cx">     if (!toJSDOMWindow(execState-&gt;lexicalGlobalObject()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebCore::reportException(execState, toJS(execState, exception));
</del><ins>+    WebCore::reportException(execState, Exception::cast(toJS(execState, exception)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InjectedBundle::didCreatePage(WebPage* page)
</span></span></pre>
</div>
</div>

</body>
</html>