Title: [166971] trunk/Source/_javascript_Core
Revision
166971
Author
commit-qu...@webkit.org
Date
2014-04-08 15:46:10 -0700 (Tue, 08 Apr 2014)

Log Message

Web Inspector: Address stale FIXMEs concerning console in JSContext inspection
https://bugs.webkit.org/show_bug.cgi?id=131398

Patch by Joseph Pecoraro <pecor...@apple.com> on 2014-04-08
Reviewed by Timothy Hatcher.

* inspector/InjectedScriptSource.js:
The console object can be deleted from a page or JSContext,
so keep code that expects that it could have been deleted
to be resilient in those cases.

* inspector/JSGlobalObjectScriptDebugServer.h:
* inspector/agents/JSGlobalObjectDebuggerAgent.h:
* inspector/agents/JSGlobalObjectRuntimeAgent.h:
Change the FIXMEs to NOTEs that explain why these functions
have empty implementations for JSContext inspection.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (166970 => 166971)


--- trunk/Source/_javascript_Core/ChangeLog	2014-04-08 22:44:39 UTC (rev 166970)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-04-08 22:46:10 UTC (rev 166971)
@@ -1,3 +1,21 @@
+2014-04-08  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Address stale FIXMEs concerning console in JSContext inspection
+        https://bugs.webkit.org/show_bug.cgi?id=131398
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InjectedScriptSource.js:
+        The console object can be deleted from a page or JSContext,
+        so keep code that expects that it could have been deleted
+        to be resilient in those cases.
+
+        * inspector/JSGlobalObjectScriptDebugServer.h:
+        * inspector/agents/JSGlobalObjectDebuggerAgent.h:
+        * inspector/agents/JSGlobalObjectRuntimeAgent.h:
+        Change the FIXMEs to NOTEs that explain why these functions
+        have empty implementations for JSContext inspection.
+
 2014-04-08  Filip Pizlo  <fpi...@apple.com>
 
         Unreviewed, fix a goofy assertion to fix debug.

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js (166970 => 166971)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2014-04-08 22:44:39 UTC (rev 166970)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2014-04-08 22:46:10 UTC (rev 166971)
@@ -209,7 +209,6 @@
         var argsArray = InjectedScriptHost.evaluate("(" + args + ")");
         var result = this[methodName].apply(this, argsArray);
         if (typeof result === "undefined") {
-            // FIXME: JS Context inspection currently does not have a global.console object.
             if (inspectedGlobalObject.console)
                 inspectedGlobalObject.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName);
             result = null;
@@ -557,7 +556,6 @@
         // When not evaluating on a call frame we use a 'with' statement to allow var and function statements to leak
         // into the global scope. This allow them to stick around between evaluations.
 
-        // FIXME: JS Context inspection currently does not have a global.console object.
         try {
             if (commandLineAPI) {
                 if (inspectedGlobalObject.console)
@@ -672,7 +670,6 @@
         delete this._modules[name];
         var moduleFunction = InjectedScriptHost.evaluate("(" + source + ")");
         if (typeof moduleFunction !== "function") {
-            // FIXME: JS Context inspection currently does not have a global.console object.
             if (inspectedGlobalObject.console)
                 inspectedGlobalObject.console.error("Web Inspector error: A function was expected for module %s evaluation", name);
             return null;

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.h (166970 => 166971)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.h	2014-04-08 22:44:39 UTC (rev 166970)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.h	2014-04-08 22:46:10 UTC (rev 166971)
@@ -53,7 +53,9 @@
     virtual void runEventLoopWhilePaused() override;
     virtual bool isContentScript(JSC::ExecState*) const override { return false; }
 
-    // FIXME: _javascript_ inspection has no Console yet.
+    // NOTE: Currently all exceptions are reported at the API boundary through reportAPIException.
+    // Until a time comes where an exception can be caused outside of the API (e.g. setTimeout
+    // or some other async operation in a pure JSContext) we can ignore exceptions reported here.
     virtual void reportException(JSC::ExecState*, JSC::JSValue) const override { }
 
     ListenerSet m_listeners;

Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.h (166970 => 166971)


--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.h	2014-04-08 22:44:39 UTC (rev 166970)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.h	2014-04-08 22:46:10 UTC (rev 166971)
@@ -50,7 +50,8 @@
 
     virtual void breakpointActionLog(JSC::ExecState*, const String&) override;
 
-    // FIXME: _javascript_ inspector does not yet have a console object to mute.
+    // NOTE: _javascript_ inspector does not yet need to mute a console because no messages
+    // are sent to the console outside of the API boundary or console object.
     virtual void muteConsole() override { }
     virtual void unmuteConsole() override { }
 

Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectRuntimeAgent.h (166970 => 166971)


--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectRuntimeAgent.h	2014-04-08 22:44:39 UTC (rev 166970)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectRuntimeAgent.h	2014-04-08 22:46:10 UTC (rev 166971)
@@ -47,7 +47,8 @@
     virtual JSC::VM& globalVM() override;
     virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) override;
 
-    // FIXME: _javascript_ inspector does not yet have a console object to mute.
+    // NOTE: _javascript_ inspector does not yet need to mute a console because no messages
+    // are sent to the console outside of the API boundary or console object.
     virtual void muteConsole() override { }
     virtual void unmuteConsole() override { }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to