| 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);
|
| }
|
| };
|
|
|