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

Unified Diff: tracing/tracing/base/utils.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/unittest/text_test_results.html ('k') | tracing/tracing/base/xhr.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/utils.html
diff --git a/tracing/tracing/base/utils.html b/tracing/tracing/base/utils.html
index 106e86f5f5b86cc99c33a242efcd50f0c88385de..8cffb7857dc742c34b87194806b2bbcd209ce4a0 100644
--- a/tracing/tracing/base/utils.html
+++ b/tracing/tracing/base/utils.html
@@ -25,27 +25,25 @@ tr.exportTo('tr.b', function() {
function deepCopy(value) {
if (!(value instanceof Object)) {
- if (value === undefined || value === null)
- return value;
- if (typeof value === 'string')
- return value.substring();
- if (typeof value === 'boolean')
- return value;
- if (typeof value === 'number')
- return value;
+ if (value === undefined || value === null) return value;
+ if (typeof value === 'string') return value.substring();
+ if (typeof value === 'boolean') return value;
+ if (typeof value === 'number') return value;
throw new Error('Unrecognized: ' + typeof value);
}
var object = value;
if (object instanceof Array) {
var res = new Array(object.length);
- for (var i = 0; i < object.length; i++)
+ for (var i = 0; i < object.length; i++) {
res[i] = deepCopy(object[i]);
+ }
return res;
}
- if (object.__proto__ !== Object.prototype)
+ if (object.__proto__ !== Object.prototype) {
throw new Error('Can only clone simple types');
+ }
var res = {};
for (var key in object) {
res[key] = deepCopy(object[key]);
« no previous file with comments | « tracing/tracing/base/unittest/text_test_results.html ('k') | tracing/tracing/base/xhr.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698