Title: [198317] trunk/Source/WebInspectorUI
Revision
198317
Author
[email protected]
Date
2016-03-16 21:42:21 -0700 (Wed, 16 Mar 2016)

Log Message

Uncaught Exception: SyntaxError: Invalid regular _expression_: \ at end of pattern
https://bugs.webkit.org/show_bug.cgi?id=155556
<rdar://problem/25200058>

Reviewed by Timothy Hatcher.

Use simpleGlobStringToRegExp, which returns a valid regular _expression_
for strings with trailing backslashes, and also provides globbing.
String.escapeForRegExp returns a JS string ending in "\\", which isn't
a valid regular _expression_.

* UserInterface/Views/OpenResourceDialog.js:
(WebInspector.OpenResourceDialog):
(WebInspector.OpenResourceDialog.prototype._handleMousedownEvent):
Fixed typo.

(WebInspector.OpenResourceDialog.prototype._updateFilter):
Switch to simpleGlobStringToRegExp.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (198316 => 198317)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-03-17 03:36:28 UTC (rev 198316)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-03-17 04:42:21 UTC (rev 198317)
@@ -1,3 +1,24 @@
+2016-03-16  Matt Baker  <[email protected]>
+
+        Uncaught Exception: SyntaxError: Invalid regular _expression_: \ at end of pattern
+        https://bugs.webkit.org/show_bug.cgi?id=155556
+        <rdar://problem/25200058>
+
+        Reviewed by Timothy Hatcher.
+
+        Use simpleGlobStringToRegExp, which returns a valid regular _expression_
+        for strings with trailing backslashes, and also provides globbing.
+        String.escapeForRegExp returns a JS string ending in "\\", which isn't
+        a valid regular _expression_.
+
+        * UserInterface/Views/OpenResourceDialog.js:
+        (WebInspector.OpenResourceDialog):
+        (WebInspector.OpenResourceDialog.prototype._handleMousedownEvent):
+        Fixed typo.
+
+        (WebInspector.OpenResourceDialog.prototype._updateFilter):
+        Switch to simpleGlobStringToRegExp.
+
 2016-03-14  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Show path from root to instances in the Heap Snapshot content view

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js (198316 => 198317)


--- trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js	2016-03-17 03:36:28 UTC (rev 198316)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js	2016-03-17 04:42:21 UTC (rev 198317)
@@ -168,7 +168,7 @@
         this._inputElement.select();
 
         // This ensures we don't get a "blur" event triggered for the text field
-        // which would end up dimissing the dialog, which is not the intent.
+        // that would cause the dialog to be dismissed.
         event.preventDefault();
     }
 
@@ -194,11 +194,8 @@
         if (!filterText)
             return;
 
-        let escapedFilterText = filterText.escapeForRegExp();
-        let r0 = new RegExp("^" + escapedFilterText, "i");
-        let r1 = simpleGlobStringToRegExp(filterText, "i");
-        let r2 = new RegExp("^" + escapedFilterText.toUpperCase().split("").join(".*?"));
-        let filters = [r0, r1, r2];
+        // FIXME: <https://webkit.org/b/155324> Web Inspector: Improve filtering in OpenResourceDialog
+        let filters = [simpleGlobStringToRegExp(filterText)];
 
         for (let resource of this._resources) {
             for (let i = 0; i < filters.length; ++i) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to