<!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>[164491] trunk/Source</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/164491">164491</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-21 12:18:59 -0800 (Fri, 21 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Revert <a href="http://trac.webkit.org/projects/webkit/changeset/164486">r164486</a>, causing a number of test failures.
Source/JavaScriptCore:
Unreviewed rollout.
Source/WebCore:
Unreviewed rollout.
Source/WebInspectorUI:
Unreviewed rollout.</pre>
<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceJavaScriptCoreAPIJSValuemm">trunk/Source/JavaScriptCore/API/JSValue.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValueRefcpp">trunk/Source/JavaScriptCore/API/JSValueRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorConsoleMessagecpp">trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorConsoleMessageh">trunk/Source/JavaScriptCore/inspector/ConsoleMessage.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="#trunkSourceJavaScriptCoreinspectorScriptCallStackcpp">trunk/Source/JavaScriptCore/inspector/ScriptCallStack.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptCallStackh">trunk/Source/JavaScriptCore/inspector/ScriptCallStack.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="#trunkSourceJavaScriptCoreinspectoragentsInspectorConsoleAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgentcpp">trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageDebuggerAgentcpp">trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorTimelineRecordFactorycpp">trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp</a></li>
<li><a href="#trunkSourceWebCorepageConsolecpp">trunk/Source/WebCore/page/Console.cpp</a></li>
<li><a href="#trunkSourceWebCorepageContentSecurityPolicycpp">trunk/Source/WebCore/page/ContentSecurityPolicy.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSBase.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSBase.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/API/JSBase.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -40,10 +40,6 @@
</span><span class="cx"> #include "SourceCode.h"
</span><span class="cx"> #include <wtf/text/StringHash.h>
</span><span class="cx">
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-#include "JSGlobalObjectInspectorController.h"
-#endif
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="cx"> JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
</span><span class="lines">@@ -69,14 +65,6 @@
</span><span class="cx"> if (evaluationException) {
</span><span class="cx"> if (exception)
</span><span class="cx"> *exception = toRef(exec, evaluationException);
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- // FIXME: If we have a debugger attached we could learn about ParseError exceptions through
- // ScriptDebugServer::sourceParsed and this path could produce a duplicate warning. The
- // Debugger path is currently ignored by inspector.
- // NOTE: If we don't have a debugger, this SourceCode will be forever lost to the inspector.
- // We could stash it in the inspector in case an inspector is ever opened.
- globalObject->inspectorController().reportAPIException(exec, evaluationException);
-#endif
</del><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -106,9 +94,6 @@
</span><span class="cx"> if (!isValidSyntax) {
</span><span class="cx"> if (exception)
</span><span class="cx"> *exception = toRef(exec, syntaxException);
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, syntaxException);
-#endif
</del><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSObjectRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSObjectRef.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSObjectRef.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/API/JSObjectRef.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -55,10 +55,6 @@
</span><span class="cx"> #include "PropertyNameArray.h"
</span><span class="cx"> #include "RegExpConstructor.h"
</span><span class="cx">
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-#include "JSGlobalObjectInspectorController.h"
-#endif
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="cx"> JSClassRef JSClassCreate(const JSClassDefinition* definition)
</span><span class="lines">@@ -149,13 +145,9 @@
</span><span class="cx">
</span><span class="cx"> JSObject* result = constructFunction(exec, exec->lexicalGlobalObject(), args, nameID, sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx"> return toRef(result);
</span><span class="lines">@@ -181,13 +173,9 @@
</span><span class="cx"> result = constructEmptyArray(exec, 0);
</span><span class="cx">
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -209,13 +197,9 @@
</span><span class="cx">
</span><span class="cx"> JSObject* result = constructDate(exec, exec->lexicalGlobalObject(), argList);
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -236,13 +220,9 @@
</span><span class="cx"> JSObject* result = ErrorInstance::create(exec, errorStructure, message);
</span><span class="cx">
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -264,13 +244,9 @@
</span><span class="cx">
</span><span class="cx"> JSObject* result = constructRegExp(exec, exec->lexicalGlobalObject(), argList);
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -332,13 +308,9 @@
</span><span class="cx">
</span><span class="cx"> JSValue jsValue = jsObject->get(exec, propertyName->identifier(&exec->vm()));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> return toRef(exec, jsValue);
</span><span class="cx"> }
</span><span class="lines">@@ -365,13 +337,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -388,13 +356,9 @@
</span><span class="cx">
</span><span class="cx"> JSValue jsValue = jsObject->get(exec, propertyIndex);
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> return toRef(exec, jsValue);
</span><span class="cx"> }
</span><span class="lines">@@ -414,13 +378,9 @@
</span><span class="cx">
</span><span class="cx"> jsObject->methodTable()->putByIndex(jsObject, exec, propertyIndex, jsValue, false);
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -437,13 +397,9 @@
</span><span class="cx">
</span><span class="cx"> bool result = jsObject->methodTable()->deleteProperty(jsObject, exec, propertyName->identifier(&exec->vm()));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -585,13 +541,9 @@
</span><span class="cx">
</span><span class="cx"> JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="lines">@@ -626,13 +578,9 @@
</span><span class="cx"> argList.append(toJS(exec, arguments[i]));
</span><span class="cx"> JSObjectRef result = toRef(construct(exec, jsObject, constructType, constructData, argList));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> result = 0;
</span><span class="cx"> }
</span><span class="cx"> return result;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValuemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValue.mm (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValue.mm        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/API/JSValue.mm        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx"> * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><span class="lines">@@ -47,12 +47,6 @@
</span><span class="cx"> #import <wtf/text/WTFString.h>
</span><span class="cx"> #import <wtf/text/StringHash.h>
</span><span class="cx">
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-#import "CallFrame.h"
-#import "JSGlobalObject.h"
-#import "JSGlobalObjectInspectorController.h"
-#endif
-
</del><span class="cx"> #if JSC_OBJC_API_ENABLED
</span><span class="cx">
</span><span class="cx"> NSString * const JSPropertyDescriptorWritableKey = @"writable";
</span><span class="lines">@@ -635,14 +629,6 @@
</span><span class="cx"> return last;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-static void reportExceptionToInspector(JSGlobalContextRef context, JSC::JSValue exception)
-{
- JSC::ExecState* exec = toJS(context);
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exception);
-}
-#endif
-
</del><span class="cx"> static JSContainerConvertor::Task valueToObjectWithoutCopy(JSGlobalContextRef context, JSValueRef value)
</span><span class="cx"> {
</span><span class="cx"> if (!JSValueIsObject(context, value)) {
</span><span class="lines">@@ -795,13 +781,8 @@
</span><span class="cx"> return containerValueToObject(context, (JSContainerConvertor::Task){ value, [NSMutableArray array], ContainerArray});
</span><span class="cx">
</span><span class="cx"> JSC::APIEntryShim shim(toJS(context));
</span><del>- if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value))) {
- JSC::JSObject* exceptionObject = JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSArray"));
- *exception = toRef(exceptionObject);
-#if ENABLE(REMOTE_INSPECTOR)
- reportExceptionToInspector(context, exceptionObject);
-#endif
- }
</del><ins>+ if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value)))
+ *exception = toRef(JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSArray")));
</ins><span class="cx"> return nil;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -817,13 +798,8 @@
</span><span class="cx"> return containerValueToObject(context, (JSContainerConvertor::Task){ value, [NSMutableDictionary dictionary], ContainerDictionary});
</span><span class="cx">
</span><span class="cx"> JSC::APIEntryShim shim(toJS(context));
</span><del>- if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value))) {
- JSC::JSObject* exceptionObject = JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSDictionary"));
- *exception = toRef(exceptionObject);
-#if ENABLE(REMOTE_INSPECTOR)
- reportExceptionToInspector(context, exceptionObject);
-#endif
- }
</del><ins>+ if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value)))
+ *exception = toRef(JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSDictionary")));
</ins><span class="cx"> return nil;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValueRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValueRef.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValueRef.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/API/JSValueRef.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx"> * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><span class="lines">@@ -48,10 +48,6 @@
</span><span class="cx"> #include <mach-o/dyld.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-#include "JSGlobalObjectInspectorController.h"
-#endif
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -206,13 +202,9 @@
</span><span class="cx">
</span><span class="cx"> bool result = JSValue::equal(exec, jsA, jsB); // false if an exception is thrown
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -248,13 +240,9 @@
</span><span class="cx"> return false;
</span><span class="cx"> bool result = jsConstructor->hasInstance(exec, jsValue); // false if an exception is thrown
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -356,13 +344,9 @@
</span><span class="cx"> if (exception)
</span><span class="cx"> *exception = 0;
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> return OpaqueJSString::create(result).leakRef();
</span><span class="lines">@@ -394,13 +378,9 @@
</span><span class="cx">
</span><span class="cx"> double number = jsValue.toNumber(exec);
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> number = QNaN;
</span><span class="cx"> }
</span><span class="cx"> return number;
</span><span class="lines">@@ -419,13 +399,9 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<OpaqueJSString> stringRef(OpaqueJSString::create(jsValue.toString(exec)->value(exec)));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> stringRef.clear();
</span><span class="cx"> }
</span><span class="cx"> return stringRef.release().leakRef();
</span><span class="lines">@@ -444,17 +420,13 @@
</span><span class="cx">
</span><span class="cx"> JSObjectRef objectRef = toRef(jsValue.toObject(exec));
</span><span class="cx"> if (exec->hadException()) {
</span><del>- JSValue exceptionValue = exec->exception();
</del><span class="cx"> if (exception)
</span><del>- *exception = toRef(exec, exceptionValue);
</del><ins>+ *exception = toRef(exec, exec->exception());
</ins><span class="cx"> exec->clearException();
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
- exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
-#endif
</del><span class="cx"> objectRef = 0;
</span><span class="cx"> }
</span><span class="cx"> return objectRef;
</span><del>-}
</del><ins>+}
</ins><span class="cx">
</span><span class="cx"> void JSValueProtect(JSContextRef ctx, JSValueRef value)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -1,3 +1,9 @@
</span><ins>+2014-02-21 Joseph Pecoraro <pecoraro@apple.com>
+
+ Revert r164486, causing a number of test failures.
+
+ Unreviewed rollout.
+
</ins><span class="cx"> 2014-02-21 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> Revive SABI (aka shouldAlwaysBeInlined)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorConsoleMessagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">
</span><span class="cx"> namespace Inspector {
</span><span class="cx">
</span><del>-ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned long requestIdentifier)
</del><ins>+ConsoleMessage::ConsoleMessage(bool canGenerateCallStack, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned long requestIdentifier)
</ins><span class="cx"> : m_source(source)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_level(level)
</span><span class="lines">@@ -56,9 +56,10 @@
</span><span class="cx"> , m_repeatCount(1)
</span><span class="cx"> , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
</span><span class="cx"> {
</span><ins>+ autogenerateMetadata(canGenerateCallStack);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* state, unsigned long requestIdentifier)
</del><ins>+ConsoleMessage::ConsoleMessage(bool canGenerateCallStack, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* state, unsigned long requestIdentifier)
</ins><span class="cx"> : m_source(source)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_level(level)
</span><span class="lines">@@ -69,31 +70,30 @@
</span><span class="cx"> , m_repeatCount(1)
</span><span class="cx"> , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
</span><span class="cx"> {
</span><del>- autogenerateMetadata(state);
</del><ins>+ autogenerateMetadata(canGenerateCallStack, state);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
</del><ins>+ConsoleMessage::ConsoleMessage(bool, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
</ins><span class="cx"> : m_source(source)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_level(level)
</span><span class="cx"> , m_message(message)
</span><del>- , m_url()
</del><ins>+ , m_arguments(nullptr)
</ins><span class="cx"> , m_line(0)
</span><span class="cx"> , m_column(0)
</span><span class="cx"> , m_repeatCount(1)
</span><span class="cx"> , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
</span><span class="cx"> {
</span><ins>+ if (callStack && callStack->size()) {
+ const ScriptCallFrame& frame = callStack->at(0);
+ m_url = frame.sourceURL();
+ m_line = frame.lineNumber();
+ m_column = frame.columnNumber();
+ }
</ins><span class="cx"> m_callStack = callStack;
</span><del>-
- const ScriptCallFrame* frame = m_callStack ? m_callStack->firstNonNativeCallFrame() : nullptr;
- if (frame) {
- m_url = frame->sourceURL();
- m_line = frame->lineNumber();
- m_column = frame->columnNumber();
- }
</del><span class="cx"> }
</span><span class="cx">
</span><del>-ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, JSC::ExecState* state, unsigned long requestIdentifier)
</del><ins>+ConsoleMessage::ConsoleMessage(bool canGenerateCallStack, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, JSC::ExecState* state, unsigned long requestIdentifier)
</ins><span class="cx"> : m_source(source)
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_level(level)
</span><span class="lines">@@ -105,30 +105,35 @@
</span><span class="cx"> , m_repeatCount(1)
</span><span class="cx"> , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
</span><span class="cx"> {
</span><del>- autogenerateMetadata(state);
</del><ins>+ autogenerateMetadata(canGenerateCallStack, state);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ConsoleMessage::~ConsoleMessage()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ConsoleMessage::autogenerateMetadata(JSC::ExecState* state)
</del><ins>+// FIXME: Remove the generate without ExecState path. The caller should always provide an ExecState.
+void ConsoleMessage::autogenerateMetadata(bool /*canGenerateCallStack*/, JSC::ExecState* state)
</ins><span class="cx"> {
</span><del>- if (!state)
</del><ins>+ if (m_type == MessageType::EndGroup)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- if (m_type == MessageType::EndGroup)
</del><ins>+ if (state)
+ m_callStack = createScriptCallStackForConsole(state);
+ // else if (canGenerateCallStack)
+ // m_callStack = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture, true);
+ else
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- // FIXME: Should this really be using "for console" in the generic ConsoleMessage autogeneration? This can skip the first frame.
- m_callStack = createScriptCallStackForConsole(state, ScriptCallStack::maxCallStackSizeToCapture);
-
- if (const ScriptCallFrame* frame = m_callStack->firstNonNativeCallFrame()) {
- m_url = frame->sourceURL();
- m_line = frame->lineNumber();
- m_column = frame->columnNumber();
</del><ins>+ if (m_callStack && m_callStack->size()) {
+ const ScriptCallFrame& frame = m_callStack->at(0);
+ m_url = frame.sourceURL();
+ m_line = frame.lineNumber();
+ m_column = frame.columnNumber();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
+ m_callStack.clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Inspector::TypeBuilder::Console::ConsoleMessage::Source::Enum messageSourceValue(MessageSource source)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorConsoleMessageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -51,10 +51,10 @@
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(ConsoleMessage);
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned long requestIdentifier = 0);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, JSC::ExecState*, unsigned long requestIdentifier = 0);
</del><ins>+ ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, unsigned long requestIdentifier = 0);
+ ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, const String& url, unsigned line, unsigned column, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
+ ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
+ ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, JSC::ExecState*, unsigned long requestIdentifier = 0);
</ins><span class="cx"> ~ConsoleMessage();
</span><span class="cx">
</span><span class="cx"> void addToFrontend(InspectorConsoleFrontendDispatcher*, InjectedScriptManager*, bool generatePreview);
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> void clear();
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- void autogenerateMetadata(JSC::ExecState* = nullptr);
</del><ins>+ void autogenerateMetadata(bool canGenerateCallStack, JSC::ExecState* = nullptr);
</ins><span class="cx">
</span><span class="cx"> MessageSource m_source;
</span><span class="cx"> MessageType m_type;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">
</span><span class="cx"> #include "Completion.h"
</span><del>-#include "ErrorHandlingScope.h"
</del><span class="cx"> #include "InjectedScriptHost.h"
</span><span class="cx"> #include "InjectedScriptManager.h"
</span><span class="cx"> #include "InspectorAgent.h"
</span><span class="lines">@@ -39,11 +38,6 @@
</span><span class="cx"> #include "JSGlobalObjectConsoleAgent.h"
</span><span class="cx"> #include "JSGlobalObjectDebuggerAgent.h"
</span><span class="cx"> #include "JSGlobalObjectRuntimeAgent.h"
</span><del>-#include "ScriptCallStack.h"
-#include "ScriptCallStackFactory.h"
-#include <cxxabi.h>
-#include <dlfcn.h>
-#include <execinfo.h>
</del><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="lines">@@ -58,8 +52,6 @@
</span><span class="cx"> auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(m_injectedScriptManager.get());
</span><span class="cx"> auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(m_injectedScriptManager.get(), m_globalObject, consoleAgent.get());
</span><span class="cx">
</span><del>- m_consoleAgent = consoleAgent.get();
-
</del><span class="cx"> runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer());
</span><span class="cx">
</span><span class="cx"> m_agents.append(std::make_unique<InspectorAgent>());
</span><span class="lines">@@ -109,51 +101,6 @@
</span><span class="cx"> m_inspectorBackendDispatcher->dispatch(message);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void JSGlobalObjectInspectorController::appendAPIBacktrace(ScriptCallStack* callStack)
-{
- static const int framesToShow = 31;
- static const int framesToSkip = 3; // WTFGetBacktrace, appendAPIBacktrace, reportAPIException.
-
- void* samples[framesToShow + framesToSkip];
- int frames = framesToShow + framesToSkip;
- WTFGetBacktrace(samples, &frames);
-
- void** stack = samples + framesToSkip;
- int size = frames - framesToSkip;
- for (int i = 0; i < size; ++i) {
- const char* mangledName = nullptr;
- char* cxaDemangled = nullptr;
- Dl_info info;
- if (dladdr(stack[i], &info) && info.dli_sname)
- mangledName = info.dli_sname;
- if (mangledName)
- cxaDemangled = abi::__cxa_demangle(mangledName, nullptr, nullptr, nullptr);
- if (mangledName || cxaDemangled)
- callStack->append(ScriptCallFrame(cxaDemangled ? cxaDemangled : mangledName, ASCIILiteral("[native code]"), 0, 0));
- else
- callStack->append(ScriptCallFrame(ASCIILiteral("?"), ASCIILiteral("[native code]"), 0, 0));
- free(cxaDemangled);
- }
-}
-
-void JSGlobalObjectInspectorController::reportAPIException(ExecState* exec, JSValue exception)
-{
- if (isTerminatedExecutionException(exception))
- return;
-
- ErrorHandlingScope errorScope(exec->vm());
-
- RefPtr<ScriptCallStack> callStack = createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture);
- appendAPIBacktrace(callStack.get());
-
- // FIXME: <http://webkit.org/b/115087> Web Inspector: Should not evaluate JavaScript handling exceptions
- // If this is a custom exception object, call toString on it to try and get a nice string representation for the exception.
- String errorMessage = exception.toString(exec)->value(exec);
- exec->clearException();
-
- m_consoleAgent->addMessageToConsole(MessageSource::JS, MessageType::Log, MessageLevel::Error, errorMessage, callStack);
-}
-
</del><span class="cx"> InspectorFunctionCallHandler JSGlobalObjectInspectorController::functionCallHandler() const
</span><span class="cx"> {
</span><span class="cx"> return JSC::call;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -37,16 +37,13 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ExecState;
</span><span class="cx"> class JSGlobalObject;
</span><del>-class JSValue;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace Inspector {
</span><span class="cx">
</span><span class="cx"> class InjectedScriptManager;
</span><span class="cx"> class InspectorBackendDispatcher;
</span><del>-class InspectorConsoleAgent;
</del><span class="cx"> class InspectorFrontendChannel;
</span><del>-class ScriptCallStack;
</del><span class="cx">
</span><span class="cx"> class JSGlobalObjectInspectorController final : public InspectorEnvironment {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(JSGlobalObjectInspectorController);
</span><span class="lines">@@ -61,8 +58,6 @@
</span><span class="cx">
</span><span class="cx"> void globalObjectDestroyed();
</span><span class="cx">
</span><del>- void reportAPIException(JSC::ExecState*, JSC::JSValue exception);
-
</del><span class="cx"> virtual bool developerExtrasEnabled() const override { return true; }
</span><span class="cx"> virtual bool canAccessInspectedScriptState(JSC::ExecState*) const override { return true; }
</span><span class="cx"> virtual InspectorFunctionCallHandler functionCallHandler() const override;
</span><span class="lines">@@ -71,11 +66,8 @@
</span><span class="cx"> virtual void didCallInjectedScriptFunction(JSC::ExecState*) override { }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- void appendAPIBacktrace(ScriptCallStack* callStack);
-
</del><span class="cx"> JSC::JSGlobalObject& m_globalObject;
</span><span class="cx"> std::unique_ptr<InjectedScriptManager> m_injectedScriptManager;
</span><del>- InspectorConsoleAgent* m_consoleAgent;
</del><span class="cx"> InspectorAgentRegistry m_agents;
</span><span class="cx"> InspectorFrontendChannel* m_inspectorFrontendChannel;
</span><span class="cx"> RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStack.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStack.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStack.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -61,25 +61,6 @@
</span><span class="cx"> return m_frames.size();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const ScriptCallFrame* ScriptCallStack::firstNonNativeCallFrame() const
-{
- if (!m_frames.size())
- return nullptr;
-
- for (size_t i = 0; i < m_frames.size(); ++i) {
- const ScriptCallFrame& frame = m_frames[i];
- if (frame.sourceURL() != "[native code]")
- return &frame;
- }
-
- return nullptr;
-}
-
-void ScriptCallStack::append(const ScriptCallFrame& frame)
-{
- m_frames.append(frame);
-}
-
</del><span class="cx"> bool ScriptCallStack::isEqual(ScriptCallStack* o) const
</span><span class="cx"> {
</span><span class="cx"> if (!o)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStack.h (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStack.h        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStack.h        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -54,10 +54,6 @@
</span><span class="cx"> const ScriptCallFrame& at(size_t) const;
</span><span class="cx"> size_t size() const;
</span><span class="cx">
</span><del>- const ScriptCallFrame* firstNonNativeCallFrame() const;
-
- void append(const ScriptCallFrame&);
-
</del><span class="cx"> bool isEqual(ScriptCallStack*) const;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="lines">@@ -65,7 +61,6 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- ScriptCallStack();
</del><span class="cx"> ScriptCallStack(Vector<ScriptCallFrame>&);
</span><span class="cx">
</span><span class="cx"> Vector<ScriptCallFrame> m_frames;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -83,18 +83,27 @@
</span><span class="cx"> size_t m_remainingCapacityForFrameCapture;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState* exec, size_t maxStackSize)
</del><ins>+PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState* exec, size_t maxStackSize, bool emptyIsAllowed)
</ins><span class="cx"> {
</span><span class="cx"> Vector<ScriptCallFrame> frames;
</span><span class="cx">
</span><del>- CallFrame* frame = exec->vm().topCallFrame;
- CreateScriptCallStackFunctor functor(false, frames, maxStackSize);
- frame->iterate(functor);
</del><ins>+ if (exec) {
+ CallFrame* frame = exec->vm().topCallFrame;
+ CreateScriptCallStackFunctor functor(false, frames, maxStackSize);
+ frame->iterate(functor);
+ }
</ins><span class="cx">
</span><ins>+ if (frames.isEmpty() && !emptyIsAllowed) {
+ // No frames found. It may happen in the case where
+ // a bound function is called from native code for example.
+ // Fallback to setting lineNumber to 0, and source and function name to "undefined".
+ frames.append(ScriptCallFrame(ASCIILiteral("undefined"), ASCIILiteral("undefined"), 0, 0));
+ }
+
</ins><span class="cx"> return ScriptCallStack::create(frames);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState* exec, size_t maxStackSize)
</del><ins>+PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState* exec, size_t maxStackSize)
</ins><span class="cx"> {
</span><span class="cx"> Vector<ScriptCallFrame> frames;
</span><span class="cx">
</span><span class="lines">@@ -110,16 +119,10 @@
</span><span class="cx"> return ScriptCallStack::create(frames);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void extractSourceInformationFromException(JSC::ExecState* exec, JSObject* exceptionObject, int* lineNumber, int* columnNumber, String* sourceURL)
</del><ins>+PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState* exec)
</ins><span class="cx"> {
</span><del>- // FIXME: <http://webkit.org/b/115087> Web Inspector: Should not need to evaluate JavaScript handling exceptions
- JSValue lineValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "line"));
- *lineNumber = lineValue && lineValue.isNumber() ? int(lineValue.toNumber(exec)) : 0;
- JSValue columnValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "column"));
- *columnNumber = columnValue && columnValue.isNumber() ? int(columnValue.toNumber(exec)) : 0;
- JSValue sourceURLValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "sourceURL"));
- *sourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : String();
- exec->clearException();
</del><ins>+ // FIXME: Caller should use createScriptCallStack alternative with the exec and appropriate max.
+ return createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState* exec, JSC::JSValue& exception, size_t maxStackSize)
</span><span class="lines">@@ -134,24 +137,22 @@
</span><span class="cx"> unsigned column;
</span><span class="cx"> stackTrace[i].computeLineAndColumn(line, column);
</span><span class="cx"> String functionName = stackTrace[i].friendlyFunctionName(exec);
</span><del>- frames.append(ScriptCallFrame(functionName, stackTrace[i].friendlySourceURL(), line, column));
</del><ins>+ frames.append(ScriptCallFrame(functionName, stackTrace[i].sourceURL, line, column));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- // Fallback to getting at least the line and sourceURL from the exception object if it has values and the exceptionStack doesn't.
- JSObject* exceptionObject = exception.toObject(exec);
- if (exception.isObject()) {
- int lineNumber;
- int columnNumber;
- String exceptionSourceURL;
- if (!frames.size()) {
- extractSourceInformationFromException(exec, exceptionObject, &lineNumber, &columnNumber, &exceptionSourceURL);
- frames.append(ScriptCallFrame(String(), exceptionSourceURL, lineNumber, columnNumber));
- } else {
- const ScriptCallFrame& firstCallFrame = frames.first();
- if (firstCallFrame.sourceURL().isEmpty()) {
- extractSourceInformationFromException(exec, exceptionObject, &lineNumber, &columnNumber, &exceptionSourceURL);
- frames[0] = ScriptCallFrame(firstCallFrame.functionName(), exceptionSourceURL, lineNumber, columnNumber);
- }
</del><ins>+ // FIXME: <http://webkit.org/b/115087> Web Inspector: WebCore::reportException should not evaluate JavaScript handling exceptions
+ // Fallback to getting at least the line and sourceURL from the exception if it has values and the exceptionStack doesn't.
+ if (frames.size() > 0) {
+ const ScriptCallFrame& firstCallFrame = frames.first();
+ JSObject* exceptionObject = exception.toObject(exec);
+ if (exception.isObject() && firstCallFrame.sourceURL().isEmpty()) {
+ JSValue lineValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "line"));
+ int lineNumber = lineValue && lineValue.isNumber() ? int(lineValue.toNumber(exec)) : 0;
+ JSValue columnValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "column"));
+ int columnNumber = columnValue && columnValue.isNumber() ? int(columnValue.toNumber(exec)) : 0;
+ JSValue sourceURLValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "sourceURL"));
+ String exceptionSourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : ASCIILiteral("undefined");
+ frames[0] = ScriptCallFrame(firstCallFrame.functionName(), exceptionSourceURL, lineNumber, columnNumber);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.h        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -45,8 +45,9 @@
</span><span class="cx"> class ScriptCallStack;
</span><span class="cx">
</span><span class="cx"> // FIXME: The subtle differences between these should be eliminated.
</span><ins>+JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState*, size_t maxStackSize, bool emptyIsAllowed);
</ins><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState*, size_t maxStackSize);
</span><del>-JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState*, size_t maxStackSize);
</del><ins>+JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState*);
</ins><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState*, JSC::JSValue& exception, size_t maxStackSize);
</span><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr<ScriptArguments> createScriptArguments(JSC::ExecState*, unsigned skipArgumentCount);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorConsoleAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> m_enabled = true;
</span><span class="cx">
</span><span class="cx"> if (m_expiredConsoleMessageCount) {
</span><del>- ConsoleMessage expiredMessage(MessageSource::Other, MessageType::Log, MessageLevel::Warning, String::format("%d console messages are not shown.", m_expiredConsoleMessageCount));
</del><ins>+ ConsoleMessage expiredMessage(!isWorkerAgent(), MessageSource::Other, MessageType::Log, MessageLevel::Warning, String::format("%d console messages are not shown.", m_expiredConsoleMessageCount));
</ins><span class="cx"> expiredMessage.addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, false);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> clearMessages(&error);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- addConsoleMessage(std::make_unique<ConsoleMessage>(source, type, level, message, callStack, requestIdentifier));
</del><ins>+ addConsoleMessage(std::make_unique<ConsoleMessage>(!isWorkerAgent(), source, type, level, message, callStack, requestIdentifier));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> clearMessages(&error);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- addConsoleMessage(std::make_unique<ConsoleMessage>(source, type, level, message, arguments, state, requestIdentifier));
</del><ins>+ addConsoleMessage(std::make_unique<ConsoleMessage>(!isWorkerAgent(), source, type, level, message, arguments, state, requestIdentifier));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* state, unsigned long requestIdentifier)
</span><span class="lines">@@ -154,7 +154,8 @@
</span><span class="cx"> clearMessages(&error);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- addConsoleMessage(std::make_unique<ConsoleMessage>(source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier));
</del><ins>+ bool canGenerateCallStack = !isWorkerAgent() && m_frontendDispatcher;
+ addConsoleMessage(std::make_unique<ConsoleMessage>(canGenerateCallStack, source, type, level, message, scriptID, lineNumber, columnNumber, state, requestIdentifier));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<unsigned> InspectorConsoleAgent::consoleMessageArgumentCounts() const
</span><span class="lines">@@ -196,7 +197,7 @@
</span><span class="cx">
</span><span class="cx"> void InspectorConsoleAgent::count(JSC::ExecState* state, PassRefPtr<ScriptArguments> arguments)
</span><span class="cx"> {
</span><del>- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state, ScriptCallStack::maxCallStackSizeToCapture));
</del><ins>+ RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state));
</ins><span class="cx"> const ScriptCallFrame& lastCaller = callStack->at(0);
</span><span class="cx"> // Follow Firebug's behavior of counting with null and undefined title in
</span><span class="cx"> // the same bucket as no argument
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsJSGlobalObjectDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">
</span><span class="cx"> void JSGlobalObjectDebuggerAgent::breakpointActionLog(JSC::ExecState* exec, const String& message)
</span><span class="cx"> {
</span><del>- m_consoleAgent->addMessageToConsole(MessageSource::JS, MessageType::Log, MessageLevel::Log, message, createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture), 0);
</del><ins>+ m_consoleAgent->addMessageToConsole(MessageSource::JS, MessageType::Log, MessageLevel::Log, message, createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture, true), 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/ChangeLog        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -1,3 +1,9 @@
</span><ins>+2014-02-21 Joseph Pecoraro <pecoraro@apple.com>
+
+ Revert r164486, causing a number of test failures.
+
+ Unreviewed rollout.
+
</ins><span class="cx"> 2014-02-21 David Kilzer <ddkilzer@apple.com>
</span><span class="cx">
</span><span class="cx"> StyleResolver::loadPendingImage() should take a reference to StylePendingImage
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -171,10 +171,20 @@
</span><span class="cx"> int lineNumber = 0;
</span><span class="cx"> int columnNumber = 0;
</span><span class="cx"> String exceptionSourceURL;
</span><del>- if (const ScriptCallFrame* callFrame = callStack->firstNonNativeCallFrame()) {
- lineNumber = callFrame->lineNumber();
- columnNumber = callFrame->columnNumber();
- exceptionSourceURL = callFrame->sourceURL();
</del><ins>+ if (callStack->size()) {
+ const ScriptCallFrame& frame = callStack->at(0);
+ lineNumber = frame.lineNumber();
+ columnNumber = frame.columnNumber();
+ exceptionSourceURL = frame.sourceURL();
+ } else {
+ // There may not be an exceptionStack for a <script> SyntaxError. Fallback to getting at least the line and sourceURL from the exception.
+ JSObject* exceptionObject = exception.toObject(exec);
+ JSValue lineValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "line"));
+ lineNumber = lineValue && lineValue.isNumber() ? int(lineValue.toNumber(exec)) : 0;
+ JSValue columnValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "column"));
+ columnNumber = columnValue && columnValue.isNumber() ? int(columnValue.toNumber(exec)) : 0;
+ JSValue sourceURLValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "sourceURL"));
+ exceptionSourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : ASCIILiteral("undefined");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String errorMessage;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -439,7 +439,7 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Inspector::TypeBuilder::Network::Initiator> InspectorResourceAgent::buildInitiatorObject(Document* document)
</span><span class="cx"> {
</span><del>- RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture);
</del><ins>+ RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture, true);
</ins><span class="cx"> if (stackTrace && stackTrace->size() > 0) {
</span><span class="cx"> RefPtr<Inspector::TypeBuilder::Network::Initiator> initiatorObject = Inspector::TypeBuilder::Network::Initiator::create()
</span><span class="cx"> .setType(Inspector::TypeBuilder::Network::Initiator::Type::Script);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">
</span><span class="cx"> void PageDebuggerAgent::breakpointActionLog(JSC::ExecState* exec, const String& message)
</span><span class="cx"> {
</span><del>- m_pageAgent->page()->console().addMessage(MessageSource::JS, MessageLevel::Log, message, createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture));
</del><ins>+ m_pageAgent->page()->console().addMessage(MessageSource::JS, MessageLevel::Log, message, createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture, true));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> InjectedScript PageDebuggerAgent::injectedScriptForEval(ErrorString* errorString, const int* executionContextId)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorTimelineRecordFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> record->setNumber("startTime", startTime);
</span><span class="cx">
</span><span class="cx"> if (maxCallStackDepth) {
</span><del>- RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), maxCallStackDepth);
</del><ins>+ RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), maxCallStackDepth, true);
</ins><span class="cx"> if (stackTrace && stackTrace->size())
</span><span class="cx"> record->setValue("stackTrace", stackTrace->buildInspectorArray());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageConsolecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Console.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Console.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/page/Console.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> size_t stackSize = printTrace ? ScriptCallStack::maxCallStackSizeToCapture : 1;
</span><del>- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state, stackSize));
</del><ins>+ RefPtr<ScriptCallStack> callStack(createScriptCallStack(state, stackSize));
</ins><span class="cx"> const ScriptCallFrame& lastCaller = callStack->at(0);
</span><span class="cx">
</span><span class="cx"> String message;
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx">
</span><span class="cx"> ScriptProfiler::start(state, resolvedTitle);
</span><span class="cx">
</span><del>- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state, 1));
</del><ins>+ RefPtr<ScriptCallStack> callStack(createScriptCallStack(state, 1));
</ins><span class="cx"> const ScriptCallFrame& lastCaller = callStack->at(0);
</span><span class="cx"> InspectorInstrumentation::addStartProfilingMessageToConsole(page, resolvedTitle, lastCaller.lineNumber(), lastCaller.columnNumber(), lastCaller.sourceURL());
</span><span class="cx"> }
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_profiles.append(profile);
</span><del>- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state, 1));
</del><ins>+ RefPtr<ScriptCallStack> callStack(createScriptCallStack(state, 1));
</ins><span class="cx"> InspectorInstrumentation::addProfile(page, profile, callStack);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx">
</span><span class="cx"> void Console::timeEnd(JSC::ExecState* state, const String& title)
</span><span class="cx"> {
</span><del>- RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state, 1));
</del><ins>+ RefPtr<ScriptCallStack> callStack(createScriptCallStackForConsole(state));
</ins><span class="cx"> InspectorInstrumentation::stopConsoleTiming(m_frame, title, callStack.release());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageContentSecurityPolicycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ContentSecurityPolicy.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ContentSecurityPolicy.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/page/ContentSecurityPolicy.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -171,6 +171,15 @@
</span><span class="cx"> return FeatureObserver::NumberOfFeatures;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+const ScriptCallFrame& getFirstNonNativeFrame(PassRefPtr<ScriptCallStack> stack)
+{
+ int frameNumber = 0;
+ if (!stack->at(0).lineNumber() && stack->size() > 1 && stack->at(1).lineNumber())
+ frameNumber = 1;
+
+ return stack->at(frameNumber);
+}
+
</ins><span class="cx"> } // namespace
</span><span class="cx">
</span><span class="cx"> static bool skipExactly(const UChar*& position, const UChar* end, UChar delimiter)
</span><span class="lines">@@ -1718,12 +1727,16 @@
</span><span class="cx"> init.sourceFile = String();
</span><span class="cx"> init.lineNumber = 0;
</span><span class="cx">
</span><del>- RefPtr<ScriptCallStack> stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2);
- const ScriptCallFrame* callFrame = stack->firstNonNativeCallFrame();
- if (callFrame && callFrame->lineNumber()) {
- URL source = URL(URL(), callFrame->sourceURL());
</del><ins>+ RefPtr<ScriptCallStack> stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2, false);
+ if (!stack)
+ return;
+
+ const ScriptCallFrame& callFrame = getFirstNonNativeFrame(stack);
+
+ if (callFrame.lineNumber()) {
+ URL source = URL(ParsedURLString, callFrame.sourceURL());
</ins><span class="cx"> init.sourceFile = stripURLForUseInReport(document, source);
</span><del>- init.lineNumber = callFrame->lineNumber();
</del><ins>+ init.lineNumber = callFrame.lineNumber();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -1764,28 +1777,31 @@
</span><span class="cx"> // harmless information.
</span><span class="cx">
</span><span class="cx"> RefPtr<InspectorObject> cspReport = InspectorObject::create();
</span><del>- cspReport->setString(ASCIILiteral("document-uri"), document->url().strippedForUseAsReferrer());
- cspReport->setString(ASCIILiteral("referrer"), document->referrer());
- cspReport->setString(ASCIILiteral("violated-directive"), directiveText);
</del><ins>+ cspReport->setString("document-uri", document->url().strippedForUseAsReferrer());
+ cspReport->setString("referrer", document->referrer());
+ cspReport->setString("violated-directive", directiveText);
</ins><span class="cx"> #if ENABLE(CSP_NEXT)
</span><span class="cx"> if (experimentalFeaturesEnabled())
</span><del>- cspReport->setString(ASCIILiteral("effective-directive"), effectiveDirective);
</del><ins>+ cspReport->setString("effective-directive", effectiveDirective);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(effectiveDirective);
</span><span class="cx"> #endif
</span><del>- cspReport->setString(ASCIILiteral("original-policy"), header);
- cspReport->setString(ASCIILiteral("blocked-uri"), stripURLForUseInReport(document, blockedURL));
</del><ins>+ cspReport->setString("original-policy", header);
+ cspReport->setString("blocked-uri", stripURLForUseInReport(document, blockedURL));
</ins><span class="cx">
</span><del>- RefPtr<ScriptCallStack> stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2);
- const ScriptCallFrame* callFrame = stack->firstNonNativeCallFrame();
- if (callFrame && callFrame->lineNumber()) {
- URL source = URL(URL(), callFrame->sourceURL());
- cspReport->setString(ASCIILiteral("source-file"), stripURLForUseInReport(document, source));
- cspReport->setNumber(ASCIILiteral("line-number"), callFrame->lineNumber());
</del><ins>+ RefPtr<ScriptCallStack> stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2, false);
+ if (stack) {
+ const ScriptCallFrame& callFrame = getFirstNonNativeFrame(stack);
+
+ if (callFrame.lineNumber()) {
+ URL source = URL(ParsedURLString, callFrame.sourceURL());
+ cspReport->setString("source-file", stripURLForUseInReport(document, source));
+ cspReport->setNumber("line-number", callFrame.lineNumber());
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<InspectorObject> reportObject = InspectorObject::create();
</span><del>- reportObject->setObject(ASCIILiteral("csp-report"), cspReport.release());
</del><ins>+ reportObject->setObject("csp-report", cspReport.release());
</ins><span class="cx">
</span><span class="cx"> RefPtr<FormData> report = FormData::create(reportObject->toJSONString().utf8());
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -846,7 +846,7 @@
</span><span class="cx"> // Capture stack trace only when inspector front-end is loaded as it may be time consuming.
</span><span class="cx"> RefPtr<ScriptCallStack> stackTrace;
</span><span class="cx"> if (InspectorInstrumentation::consoleAgentEnabled(sourceDocument))
</span><del>- stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture);
</del><ins>+ stackTrace = createScriptCallStack(JSMainThreadExecState::currentState(), ScriptCallStack::maxCallStackSizeToCapture, true);
</ins><span class="cx">
</span><span class="cx"> // Schedule the message.
</span><span class="cx"> PostMessageTimer* timer = new PostMessageTimer(this, message, sourceOrigin, &source, std::move(channels), target.get(), stackTrace.release());
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -1,5 +1,11 @@
</span><span class="cx"> 2014-02-21 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><ins>+ Revert r164486, causing a number of test failures.
+
+ Unreviewed rollout.
+
+2014-02-21 Joseph Pecoraro <pecoraro@apple.com>
+
</ins><span class="cx"> Web Inspector: JSContext inspection should report exceptions in the console
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=128776
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceConsoleMessageImpljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js (164490 => 164491)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js        2014-02-21 19:48:25 UTC (rev 164490)
+++ trunk/Source/WebInspectorUI/UserInterface/ConsoleMessageImpl.js        2014-02-21 20:18:59 UTC (rev 164491)
</span><span class="lines">@@ -109,11 +109,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (this.source !== WebInspector.ConsoleMessage.MessageSource.Network || this._request) {
</span><del>- var firstNonNativeCallFrame = this._firstNonNativeCallFrame();
- if (firstNonNativeCallFrame) {
- var urlElement = this._linkifyCallFrame(firstNonNativeCallFrame);
</del><ins>+ if (this._stackTrace && this._stackTrace.length && this._stackTrace[0].url) {
+ var urlElement = this._linkifyCallFrame(this._stackTrace[0]);
</ins><span class="cx"> this._formattedMessage.appendChild(urlElement);
</span><del>- } else if (this.url && !this._shouldHideURL(this.url)) {
</del><ins>+ } else if (this.url && this.url !== "undefined") {
</ins><span class="cx"> var urlElement = this._linkifyLocation(this.url, this.line, this.column);
</span><span class="cx"> this._formattedMessage.appendChild(urlElement);
</span><span class="cx"> }
</span><span class="lines">@@ -146,26 +145,6 @@
</span><span class="cx"> return !!this._stackTrace && this._stackTrace.length && (this.source === WebInspector.ConsoleMessage.MessageSource.Network || this.level === WebInspector.ConsoleMessage.MessageLevel.Error || this.type === WebInspector.ConsoleMessage.MessageType.Trace);
</span><span class="cx"> },
</span><span class="cx">
</span><del>- _shouldHideURL: function(url)
- {
- return url === "undefined" || url === "[native code]";
- },
-
- _firstNonNativeCallFrame: function()
- {
- if (!this._stackTrace)
- return null;
-
- for (var i = 0; i < this._stackTrace.length; i++) {
- var frame = this._stackTrace[i];
- if (!frame.url || frame.url === "[native code]")
- continue;
- return frame;
- }
-
- return null;
- },
-
</del><span class="cx"> get message()
</span><span class="cx"> {
</span><span class="cx"> // force message formatting
</span><span class="lines">@@ -547,7 +526,7 @@
</span><span class="cx"> messageTextElement.appendChild(document.createTextNode(functionName));
</span><span class="cx"> content.appendChild(messageTextElement);
</span><span class="cx">
</span><del>- if (frame.url && !this._shouldHideURL(frame.url)) {
</del><ins>+ if (frame.url) {
</ins><span class="cx"> var urlElement = this._linkifyCallFrame(frame);
</span><span class="cx"> content.appendChild(urlElement);
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>