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

Unified Diff: ui/webui/resources/js/cr.js

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well Created 4 years 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 | « ui/webui/resources/js/chromeos/ui_account_tweaks.js ('k') | ui/webui/resources/js/cr/event_target.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr.js
diff --git a/ui/webui/resources/js/cr.js b/ui/webui/resources/js/cr.js
index 14bccfb778ea2c0216918456a8065a388b23c621..c18569508986426839993c39c68b3008ad68c6b9 100644
--- a/ui/webui/resources/js/cr.js
+++ b/ui/webui/resources/js/cr.js
@@ -109,13 +109,19 @@ var cr = cr || function() {
switch (kind) {
case PropertyKind.JS:
var privateName = name + '_';
- return function() { return this[privateName]; };
+ return function() {
+ return this[privateName];
+ };
case PropertyKind.ATTR:
var attributeName = getAttributeName(name);
- return function() { return this.getAttribute(attributeName); };
+ return function() {
+ return this.getAttribute(attributeName);
+ };
case PropertyKind.BOOL_ATTR:
var attributeName = getAttributeName(name);
- return function() { return this.hasAttribute(attributeName); };
+ return function() {
+ return this.hasAttribute(attributeName);
+ };
}
// TODO(dbeam): replace with assertNotReached() in assert.js when I can coax
@@ -214,7 +220,9 @@ var cr = cr || function() {
/**
* @return {number} A new unique ID.
*/
- function createUid() { return uidCounter++; }
+ function createUid() {
+ return uidCounter++;
+ }
/**
* Returns a unique ID for the item. This mutates the item so it needs to be
@@ -440,24 +448,38 @@ var cr = cr || function() {
webUIListenerCallback: webUIListenerCallback,
webUIResponse: webUIResponse,
- get doc() { return document; },
+ get doc() {
+ return document;
+ },
/** Whether we are using a Mac or not. */
- get isMac() { return /Mac/.test(navigator.platform); },
+ get isMac() {
+ return /Mac/.test(navigator.platform);
+ },
/** Whether this is on the Windows platform or not. */
- get isWindows() { return /Win/.test(navigator.platform); },
+ get isWindows() {
+ return /Win/.test(navigator.platform);
+ },
/** Whether this is on chromeOS or not. */
- get isChromeOS() { return /CrOS/.test(navigator.userAgent); },
+ get isChromeOS() {
+ return /CrOS/.test(navigator.userAgent);
+ },
/** Whether this is on vanilla Linux (not chromeOS). */
- get isLinux() { return /Linux/.test(navigator.userAgent); },
+ get isLinux() {
+ return /Linux/.test(navigator.userAgent);
+ },
/** Whether this is on Android. */
- get isAndroid() { return /Android/.test(navigator.userAgent); },
+ get isAndroid() {
+ return /Android/.test(navigator.userAgent);
+ },
/** Whether this is on iOS. */
- get isIOS() { return /iPad|iPhone|iPod/.test(navigator.platform); }
+ get isIOS() {
+ return /iPad|iPhone|iPod/.test(navigator.platform);
+ }
};
}();
« no previous file with comments | « ui/webui/resources/js/chromeos/ui_account_tweaks.js ('k') | ui/webui/resources/js/cr/event_target.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698