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

Unified Diff: tracing/tracing/mre/function_handle.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/mre/file_handle.html ('k') | tracing/tracing/mre/job.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/mre/function_handle.html
diff --git a/tracing/tracing/mre/function_handle.html b/tracing/tracing/mre/function_handle.html
index 1cd3626ef26ba4e677f637e130cb451a53e1f0da..da1aecd1df9495191730c66d4fb3688f5af5f0d4 100644
--- a/tracing/tracing/mre/function_handle.html
+++ b/tracing/tracing/mre/function_handle.html
@@ -22,10 +22,12 @@ tr.exportTo('tr.mre', function() {
};
FunctionRegistry.register = function(func) {
- if (func.name === '')
+ if (func.name === '') {
throw new Error('Registered functions must not be anonymous');
- if (this.allFunctionsByName[func.name] !== undefined)
+ }
+ if (this.allFunctionsByName[func.name] !== undefined) {
throw new Error('Function named ' + func.name + 'is already registered.');
+ }
this.allFunctionsByName[func.name] = func;
this.allFunctions.push(func);
};
@@ -42,14 +44,16 @@ tr.exportTo('tr.mre', function() {
ModuleToLoad.prototype = {
asDict: function() {
- if (this.href !== undefined)
+ if (this.href !== undefined) {
return {'href': this.href};
+ }
return {'filename': this.filename};
},
toString: function() {
- if (this.href !== undefined)
+ if (this.href !== undefined) {
return 'ModuleToLoad(href="' + this.href + '")';
+ }
return 'ModuleToLoad(filename="' + this.filename + '")';
}
};
@@ -59,10 +63,12 @@ tr.exportTo('tr.mre', function() {
};
function FunctionHandle(modulesToLoad, functionName, opt_options) {
- if (!(modulesToLoad instanceof Array))
+ if (!(modulesToLoad instanceof Array)) {
throw new Error('modulesToLoad in FunctionHandle must be an array');
- if (typeof(functionName) !== 'string')
+ }
+ if (typeof(functionName) !== 'string') {
throw new Error('functionName in FunctionHandle must be a string');
+ }
this.modulesToLoad = modulesToLoad;
this.functionName = functionName;
this.options_ = opt_options;
« no previous file with comments | « tracing/tracing/mre/file_handle.html ('k') | tracing/tracing/mre/job.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698