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

Unified Diff: tracing/tracing/base/extension_registry_type_based.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_basic.html ('k') | tracing/tracing/base/guid.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/extension_registry_type_based.html
diff --git a/tracing/tracing/base/extension_registry_type_based.html b/tracing/tracing/base/extension_registry_type_based.html
index db3c68b6e3f2e38330f30d27ab37947d141fd5d4..92f8afbef80988d110d67d3ca1d13ac21f76be20 100644
--- a/tracing/tracing/base/extension_registry_type_based.html
+++ b/tracing/tracing/base/extension_registry_type_based.html
@@ -36,8 +36,9 @@ tr.exportTo('tr.b', function() {
typeInfo.typeNames = [];
typeInfo.categoryParts = [];
- if (metadata && metadata.typeName)
+ if (metadata && metadata.typeName) {
typeInfo.typeNames.push(metadata.typeName);
+ }
if (metadata && metadata.typeNames) {
typeInfo.typeNames.push.apply(
typeInfo.typeNames, metadata.typeNames);
@@ -48,13 +49,15 @@ tr.exportTo('tr.b', function() {
}
if (typeInfo.typeNames.length === 0 &&
- typeInfo.categoryParts.length === 0)
+ typeInfo.categoryParts.length === 0) {
throw new Error('typeName or typeNames must be provided');
+ }
// Sanity checks...
typeInfo.typeNames.forEach(function(typeName) {
- if (registry.typeNameToTypeInfoMap_.has(typeName))
+ if (registry.typeNameToTypeInfoMap_.has(typeName)) {
throw new Error('typeName ' + typeName + ' already registered');
+ }
});
typeInfo.categoryParts.forEach(function(categoryPart) {
if (registry.categoryPartToTypeInfoMap_.has(categoryPart)) {
@@ -112,8 +115,9 @@ tr.exportTo('tr.b', function() {
break;
}
}
- if (typeInfoIndex === -1)
+ if (typeInfoIndex === -1) {
throw new Error(constructor + ' not registered');
+ }
var typeInfo = registry.registeredTypeInfos_[typeInfoIndex];
registry.registeredTypeInfos_.splice(typeInfoIndex, 1);
@@ -133,13 +137,11 @@ tr.exportTo('tr.b', function() {
for (var i = 0; i < categoryParts.length; i++) {
var categoryPart = categoryParts[i];
var typeInfo = registry.categoryPartToTypeInfoMap_.get(categoryPart);
- if (typeInfo !== undefined)
- return typeInfo;
+ if (typeInfo !== undefined) return typeInfo;
}
}
var typeInfo = registry.typeNameToTypeInfoMap_.get(typeName);
- if (typeInfo !== undefined)
- return typeInfo;
+ if (typeInfo !== undefined) return typeInfo;
return extensionRegistryOptions.defaultTypeInfo;
};
@@ -147,8 +149,7 @@ tr.exportTo('tr.b', function() {
// TODO(nduca): Remove or rename.
registry.getConstructor = function(category, typeName) {
var typeInfo = registry.getTypeInfo(category, typeName);
- if (typeInfo)
- return typeInfo.constructor;
+ if (typeInfo) return typeInfo.constructor;
return undefined;
};
}
« no previous file with comments | « tracing/tracing/base/extension_registry_basic.html ('k') | tracing/tracing/base/guid.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698