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

Unified Diff: tracing/tracing/core/filter.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 years, 9 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 | « tracing/tracing/base/xhr.html ('k') | tracing/tracing/core/scripting_controller.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/core/filter.html
diff --git a/tracing/tracing/core/filter.html b/tracing/tracing/core/filter.html
index 99685d21e9a9e86105c85933aea282c3150108ce..cd11d82ed3b3b2466e1d1db34ea0cf13145b622d 100644
--- a/tracing/tracing/core/filter.html
+++ b/tracing/tracing/core/filter.html
@@ -55,15 +55,17 @@ tr.exportTo('tr.c', function() {
Filter.call(this);
this.regex_ = makeCaseInsensitiveRegex(text);
- if (!text.length)
+ if (!text.length) {
throw new Error('Filter text is empty.');
+ }
}
TitleOrCategoryFilter.prototype = {
__proto__: Filter.prototype,
matchSlice: function(slice) {
- if (slice.title === undefined && slice.category === undefined)
+ if (slice.title === undefined && slice.category === undefined) {
return false;
+ }
return this.regex_.test(slice.title) ||
(!!slice.category && this.regex_.test(slice.category));
@@ -77,8 +79,9 @@ tr.exportTo('tr.c', function() {
Filter.call(this);
this.text_ = text;
- if (!text.length)
+ if (!text.length) {
throw new Error('Filter text is empty.');
+ }
}
ExactTitleFilter.prototype = {
__proto__: Filter.prototype,
@@ -104,19 +107,15 @@ tr.exportTo('tr.c', function() {
matchObject_: function(obj) {
for (var key in obj) {
- if (!obj.hasOwnProperty(key))
- continue;
- if (this.regex_.test(key))
- return true;
- if (this.regex_.test(obj[key]))
- return true;
+ if (!obj.hasOwnProperty(key)) continue;
+ if (this.regex_.test(key)) return true;
+ if (this.regex_.test(obj[key])) return true;
}
return false;
},
matchSlice: function(slice) {
- if (this.titleOrCategoryFilter_.matchSlice(slice))
- return true;
+ if (this.titleOrCategoryFilter_.matchSlice(slice)) return true;
return this.matchObject_(slice.args);
}
};
« no previous file with comments | « tracing/tracing/base/xhr.html ('k') | tracing/tracing/core/scripting_controller.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698