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

Unified Diff: tracing/tracing/mre/mre_result.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
Index: tracing/tracing/mre/mre_result.html
diff --git a/tracing/tracing/mre/mre_result.html b/tracing/tracing/mre/mre_result.html
index 9df0d204ad6b6b77048c081404cab3356b372db4..e5cc92327791bee89ca9855137a3f25495ddea9e 100644
--- a/tracing/tracing/mre/mre_result.html
+++ b/tracing/tracing/mre/mre_result.html
@@ -12,10 +12,12 @@ found in the LICENSE file.
tr.exportTo('tr.mre', function() {
class MreResult {
constructor(failures, pairs) {
- if (failures === undefined)
+ if (failures === undefined) {
failures = [];
- if (pairs === undefined)
+ }
+ if (pairs === undefined) {
pairs = {};
+ }
this.failures = failures;
this.pairs = pairs;
}
@@ -25,8 +27,9 @@ tr.exportTo('tr.mre', function() {
}
addPair(key, value) {
- if (key in this.pairs)
+ if (key in this.pairs) {
throw new Error('Key ' + key + ' already exists in result.');
+ }
this.pairs[key] = value;
}
@@ -35,8 +38,9 @@ tr.exportTo('tr.mre', function() {
pairs: this.pairs
};
- if (this.failures)
+ if (this.failures) {
d.failures = this.failures.map(function(f) {return f.asDict();});
+ }
return d;
}
@@ -46,8 +50,9 @@ tr.exportTo('tr.mre', function() {
}
static fromDict(resultDict) {
- if (resultDict.failures !== undefined)
+ if (resultDict.failures !== undefined) {
var failures = resultDict.failures.map(tr.mre.Failure.fromDict);
+ }
var pairs = resultDict.pairs;
return new MreResult(failures, pairs);
}
« no previous file with comments | « tracing/tracing/mre/map_single_trace_cmdline.html ('k') | tracing/tracing/mre/reduce_map_results_cmdline.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698