Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: Source/WebCore/inspector/front-end/utilities.js

Issue 8368025: Merge 97959 - Web Inspector: Enable support for advanced search in script's static content provider. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/front-end/SourceFrame.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/utilities.js
===================================================================
--- Source/WebCore/inspector/front-end/utilities.js (revision 98227)
+++ Source/WebCore/inspector/front-end/utilities.js (working copy)
@@ -976,10 +976,36 @@
}
/**
+ * @param {string} query
+ * @param {boolean} ignoreCase
+ * @param {boolean} isRegex
+ * @return {RegExp}
+ */
+function createSearchRegex(query, caseSensitive, isRegex)
+{
+ var regexFlags = caseSensitive ? "g" : "gi";
+ var regexObject;
+
+ if (isRegex) {
+ try {
+ regexObject = new RegExp(query, regexFlags);
+ } catch (e) {
+ // Silent catch.
+ }
+ }
+
+ if (!regexObject)
+ regexObject = createPlainTextSearchRegex(query, regexFlags);
+
+ return regexObject;
+}
+
+/**
+ * @param {string} query
* @param {string=} flags
* @return {RegExp}
*/
-function createSearchRegex(query, flags)
+function createPlainTextSearchRegex(query, flags)
{
// This should be kept the same as the one in ContentSearchUtils.cpp.
var regexSpecialCharacters = "[](){}+-*.,?\\^$|";
« no previous file with comments | « Source/WebCore/inspector/front-end/SourceFrame.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698