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

Unified Diff: tracing/tracing/base/extension_registry_base.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/extension_registry.html ('k') | tracing/tracing/base/extension_registry_basic.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/extension_registry_base.html
diff --git a/tracing/tracing/base/extension_registry_base.html b/tracing/tracing/base/extension_registry_base.html
index af6910b741fd6198651aed6440d007550b49244b..13879dde09c5c469bb558365029d92a07e2762fc 100644
--- a/tracing/tracing/base/extension_registry_base.html
+++ b/tracing/tracing/base/extension_registry_base.html
@@ -19,10 +19,12 @@ tr.exportTo('tr.b', function() {
var ALL_MODES = {BASIC_REGISTRY_MODE: true, TYPE_BASED_REGISTRY_MODE: true};
function ExtensionRegistryOptions(mode) {
- if (mode === undefined)
+ if (mode === undefined) {
throw new Error('Mode is required');
- if (!ALL_MODES[mode])
+ }
+ if (!ALL_MODES[mode]) {
throw new Error('Not a mode.');
+ }
this.mode_ = mode;
this.defaultMetadata_ = {};
@@ -32,8 +34,9 @@ tr.exportTo('tr.b', function() {
}
ExtensionRegistryOptions.prototype = {
freeze: function() {
- if (this.frozen_)
+ if (this.frozen_) {
throw new Error('Frozen');
+ }
this.frozen_ = true;
},
@@ -46,8 +49,9 @@ tr.exportTo('tr.b', function() {
},
set defaultMetadata(defaultMetadata) {
- if (this.frozen_)
+ if (this.frozen_) {
throw new Error('Frozen');
+ }
this.defaultMetadata_ = defaultMetadata;
this.defaultTypeInfo_ = undefined;
},
@@ -57,8 +61,9 @@ tr.exportTo('tr.b', function() {
},
set defaultConstructor(defaultConstructor) {
- if (this.frozen_)
+ if (this.frozen_) {
throw new Error('Frozen');
+ }
this.defaultConstructor_ = defaultConstructor;
this.defaultTypeInfo_ = undefined;
},
@@ -73,8 +78,7 @@ tr.exportTo('tr.b', function() {
},
validateConstructor: function(constructor) {
- if (!this.mandatoryBaseClass)
- return;
+ if (!this.mandatoryBaseClass) return;
var curProto = constructor.prototype.__proto__;
var ok = false;
while (curProto) {
@@ -84,8 +88,9 @@ tr.exportTo('tr.b', function() {
}
curProto = curProto.__proto__;
}
- if (!ok)
+ if (!ok) {
throw new Error(constructor + 'must be subclass of ' + registry);
+ }
}
};
« no previous file with comments | « tracing/tracing/base/extension_registry.html ('k') | tracing/tracing/base/extension_registry_basic.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698