Title: [210009] trunk/Source/WebInspectorUI
Revision
210009
Author
commit-qu...@webkit.org
Date
2016-12-19 18:01:21 -0800 (Mon, 19 Dec 2016)

Log Message

Web Inspector: Address some assertions and uncaught exceptions seen using Inspector
https://bugs.webkit.org/show_bug.cgi?id=166048

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-12-19
Reviewed by Matt Baker.

* UserInterface/Controllers/CodeMirrorEditingController.js:
(WebInspector.CodeMirrorEditingController.prototype.presentHoverMenu):
(WebInspector.CodeMirrorEditingController.prototype.dismissHoverMenu):
classList throws an exception when given an empty string. Avoid those cases.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._startTracking):
(WebInspector.CodeMirrorTokenTrackingController.prototype._stopTracking):
Seen this assert frequently for a while, existing code handles it gracefully.

* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
We correctly handle these tokens but they were not in the list of expected tokens.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (210008 => 210009)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-12-20 01:55:06 UTC (rev 210008)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-12-20 02:01:21 UTC (rev 210009)
@@ -1,3 +1,24 @@
+2016-12-19  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Address some assertions and uncaught exceptions seen using Inspector
+        https://bugs.webkit.org/show_bug.cgi?id=166048
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Controllers/CodeMirrorEditingController.js:
+        (WebInspector.CodeMirrorEditingController.prototype.presentHoverMenu):
+        (WebInspector.CodeMirrorEditingController.prototype.dismissHoverMenu):
+        classList throws an exception when given an empty string. Avoid those cases.
+
+        * UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
+        (WebInspector.CodeMirrorTokenTrackingController.prototype._startTracking):
+        (WebInspector.CodeMirrorTokenTrackingController.prototype._stopTracking):
+        Seen this assert frequently for a while, existing code handles it gracefully.
+
+        * UserInterface/Workers/Formatter/EsprimaFormatter.js:
+        (EsprimaFormatter.prototype._handleTokenAtNode):
+        We correctly handle these tokens but they were not in the list of expected tokens.
+
 2016-12-16  Joseph Pecoraro  <pecor...@apple.com>
 
         JSContext Inspector: Avoid some possible exceptions inspecting a JSContext

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js (210008 => 210009)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js	2016-12-20 01:55:06 UTC (rev 210008)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorEditingController.js	2016-12-20 02:01:21 UTC (rev 210009)
@@ -124,6 +124,9 @@
 
     presentHoverMenu()
     {
+        if (!this.cssClassName)
+            return;
+
         this._hoverMenu = new WebInspector.HoverMenu(this);
         this._hoverMenu.element.classList.add(this.cssClassName);
         this._rects = this._marker.rects;
@@ -132,6 +135,9 @@
 
     dismissHoverMenu(discrete)
     {
+        if (!this._hoverMenu)
+            return;
+
         this._hoverMenu.dismiss(discrete);
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js (210008 => 210009)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js	2016-12-20 01:55:06 UTC (rev 210008)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js	2016-12-20 02:01:21 UTC (rev 210009)
@@ -194,7 +194,6 @@
 
     _startTracking()
     {
-        console.assert(!this._tracking);
         if (this._tracking)
             return;
 
@@ -210,7 +209,6 @@
 
     _stopTracking()
     {
-        console.assert(this._tracking);
         if (!this._tracking)
             return;
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js (210008 => 210009)


--- trunk/Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js	2016-12-20 01:55:06 UTC (rev 210008)
+++ trunk/Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js	2016-12-20 02:01:21 UTC (rev 210009)
@@ -687,7 +687,7 @@
         }
 
         if (nodeType === "Property") {
-            console.assert(tokenValue === ":" || tokenValue === "get" || tokenValue === "set" || tokenValue === "async" || tokenValue === "*" || tokenValue === "[" || tokenValue === "]", token);
+            console.assert(tokenValue === ":" || tokenValue === "get" || tokenValue === "set" || tokenValue === "async" || tokenValue === "*" || tokenValue === "[" || tokenValue === "]" || tokenValue === "(" || tokenValue === ")", token);
             builder.appendToken(tokenValue, tokenOffset);
             if (tokenValue === ":" || tokenValue === "get" || tokenValue === "set" || tokenValue === "async")
                 builder.appendSpace();
@@ -695,7 +695,7 @@
         }
 
         if (nodeType === "MethodDefinition") {
-            console.assert(tokenValue === "static" || tokenValue === "get" || tokenValue === "set" || tokenValue === "async" || tokenValue === "*" || tokenValue === "[" || tokenValue === "]", token);
+            console.assert(tokenValue === "static" || tokenValue === "get" || tokenValue === "set" || tokenValue === "async" || tokenValue === "*" || tokenValue === "[" || tokenValue === "]" || tokenValue === "(" || tokenValue === ")", token);
             builder.appendToken(tokenValue, tokenOffset);
             if (tokenValue === "static" || tokenValue === "get" || tokenValue === "set" || tokenValue === "async")
                 builder.appendSpace();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to