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

Unified Diff: tracing/tracing/model/time_to_object_instance_map.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: Fix test 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/model/time_to_object_instance_map.html
diff --git a/tracing/tracing/model/time_to_object_instance_map.html b/tracing/tracing/model/time_to_object_instance_map.html
index 274bee99fe2e77442645cd46d82200670f2c5d58..5614037b6bc38a0d993be2bdcd657d25f8014b22 100644
--- a/tracing/tracing/model/time_to_object_instance_map.html
+++ b/tracing/tracing/model/time_to_object_instance_map.html
@@ -102,11 +102,11 @@ tr.exportTo('tr.model', function() {
var lastValidIndex;
for (var i = this.instances.length - 1; i >= 0; i--) {
var tmp = this.instances[i];
- if (ts >= tmp.deletionTs)
- break;
+ if (ts >= tmp.deletionTs) break;
if (tmp.creationTsWasExplicit === false &&
- tmp.snapshots.length === 0)
+ tmp.snapshots.length === 0) {
lastValidIndex = i;
+ }
}
if (lastValidIndex === undefined) {
throw new Error(
@@ -123,8 +123,7 @@ tr.exportTo('tr.model', function() {
},
get lastInstance() {
- if (this.instances.length === 0)
- return undefined;
+ if (this.instances.length === 0) return undefined;
return this.instances[this.instances.length - 1];
},
@@ -134,15 +133,17 @@ tr.exportTo('tr.model', function() {
this.parent, this.scopedId, category, name, ts));
}
var lastInstance = this.instances[this.instances.length - 1];
- if (ts < lastInstance.creationTs)
+ if (ts < lastInstance.creationTs) {
throw new Error('Cannot delete an id before it was created');
+ }
if (lastInstance.deletionTs === Number.MAX_VALUE) {
lastInstance.wasDeleted(ts);
return lastInstance;
}
- if (ts < lastInstance.deletionTs)
+ if (ts < lastInstance.deletionTs) {
throw new Error('id was already deleted earlier.');
+ }
// A new instance was deleted with no snapshots in-between.
// Create an instance then kill it.
@@ -160,8 +161,9 @@ tr.exportTo('tr.model', function() {
function(inst) { return inst.deletionTs - inst.creationTs; },
ts);
if (i < 0) {
- if (this.instances[0].creationTsWasExplicit)
+ if (this.instances[0].creationTsWasExplicit) {
return undefined;
+ }
return this.instances[0];
} else if (i >= this.instances.length) {
return undefined;

Powered by Google App Engine
This is Rietveld 408576698