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

Unified Diff: tracing/tracing/ui/base/ui.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/ui/base/timing_tool.html ('k') | tracing/tracing/ui/base/ui_state.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/base/ui.html
diff --git a/tracing/tracing/ui/base/ui.html b/tracing/tracing/ui/base/ui.html
index bd82e362e571422e6b65b70f2ee340dda7a151f9..3ece524802582adf8923857106599b3ad7510e07 100644
--- a/tracing/tracing/ui/base/ui.html
+++ b/tracing/tracing/ui/base/ui.html
@@ -19,14 +19,16 @@ tr.exportTo('tr.ui.b', function() {
*/
function decorate(source, constr) {
var elements;
- if (typeof source === 'string')
+ if (typeof source === 'string') {
elements = Polymer.dom(tr.doc).querySelectorAll(source);
- else
+ } else {
elements = [source];
+ }
for (var i = 0, el; el = elements[i]; i++) {
- if (!(el instanceof constr))
+ if (!(el instanceof constr)) {
constr.decorate(el);
+ }
}
}
@@ -77,17 +79,19 @@ tr.exportTo('tr.ui.b', function() {
}
var className = className.toLowerCase();
- if (opt_parentConstructor && !opt_parentConstructor.tagName)
+ if (opt_parentConstructor && !opt_parentConstructor.tagName) {
throw new Error('opt_parentConstructor was not ' +
'created by tr.ui.b.define');
+ }
// Walk up the parent constructors until we can find the type of tag
// to create.
var tagName = className;
var tagNS = undefined;
if (opt_parentConstructor) {
- if (opt_tagNS)
+ if (opt_tagNS) {
throw new Error('Must not specify tagNS if parentConstructor is given');
+ }
var parent = opt_parentConstructor;
while (parent && parent.tagName) {
tagName = parent.tagName;
@@ -114,10 +118,11 @@ tr.exportTo('tr.ui.b', function() {
}
var el;
- if (tagNS === undefined)
+ if (tagNS === undefined) {
el = tr.doc.createElement(tagName);
- else
+ } else {
el = tr.doc.createElementNS(tagNS, tagName);
+ }
f.decorate.call(this, el, arguments);
return el;
}
@@ -138,8 +143,9 @@ tr.exportTo('tr.ui.b', function() {
f.parentConstructor = (opt_parentConstructor ? opt_parentConstructor :
undefined);
f.toString = function() {
- if (!f.parentConstructor)
+ if (!f.parentConstructor) {
return f.tagName;
+ }
return f.parentConstructor.toString() + '::' + f.className;
};
@@ -147,13 +153,11 @@ tr.exportTo('tr.ui.b', function() {
}
function elementIsChildOf(el, potentialParent) {
- if (el === potentialParent)
- return false;
+ if (el === potentialParent) return false;
var cur = el;
while (Polymer.dom(cur).parentNode) {
- if (cur === potentialParent)
- return true;
+ if (cur === potentialParent) return true;
cur = Polymer.dom(cur).parentNode;
}
return false;
« no previous file with comments | « tracing/tracing/ui/base/timing_tool.html ('k') | tracing/tracing/ui/base/ui_state.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698