Bug 1364386 - Use only file name for search; r=nchevobbe
authorJan Odvarko <odvarko@gmail.com>
Tue, 16 May 2017 16:25:08 +0200
changeset 359040 75bc9f14232552dcad16914b3a7ea289aed98490
parent 359039 6a2176a264959e19e4a4cbcb18fd47b9653745f8
child 359041 b02281ac790d0bcf240bcf0213d7a1e5502dc274
push id31849
push userryanvm@gmail.com
push dateFri, 19 May 2017 15:38:10 +0000
treeherdermozilla-central@52b207e50972 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1364386
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1364386 - Use only file name for search; r=nchevobbe MozReview-Commit-ID: U26CX1EbLP
devtools/client/webconsole/new-console-output/selectors/messages.js
--- a/devtools/client/webconsole/new-console-output/selectors/messages.js
+++ b/devtools/client/webconsole/new-console-output/selectors/messages.js
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages");
 const { getAllFilters } = require("devtools/client/webconsole/new-console-output/selectors/filters");
 const { getLogLimit } = require("devtools/client/webconsole/new-console-output/selectors/prefs");
 const { getGripPreviewItems } = require("devtools/client/shared/components/reps/reps");
+const { getSourceNames } = require("devtools/client/shared/source-utils");
 const {
   MESSAGE_TYPE,
   MESSAGE_SOURCE
 } = require("devtools/client/webconsole/new-console-output/constants");
 
 function getAllMessages(state) {
   let messages = getAllMessagesById(state);
   let logLimit = getLogLimit(state);
@@ -126,18 +127,19 @@ function matchSearchFilters(message, fil
 
 /**
  * Returns true if given text is included in provided stack frame.
  */
 function isTextInFrame(text, frame) {
   if (!frame) {
     return false;
   }
-  return Object.values(frame)
-    .join(":")
+
+  const { short } = getSourceNames(frame.source);
+  return `${short}:${frame.line}:${frame.column}`
     .toLocaleLowerCase()
     .includes(text.toLocaleLowerCase());
 }
 
 /**
  * Returns true if given text is included in provided parameters.
  */
 function isTextInParameters(text, parameters) {