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

Unified Diff: chrome/browser/resources/options/autofill_edit_creditcard_overlay.js

Issue 553573003: Compile chrome://settings, part 3: 167 proper errors left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@G_options_errors_1
Patch Set: rebase Created 6 years, 3 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
Index: chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
diff --git a/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js b/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
index 3a77590555a4086feba72c6b6b3857f07479fa85..d3e82cbc45875ca61d263639af3b33325a2e99d5 100644
--- a/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
+++ b/chrome/browser/resources/options/autofill_edit_creditcard_overlay.js
@@ -110,15 +110,10 @@ cr.define('options', function() {
var expirationMonth = $('expiration-month');
expirationMonth.options.length = 0;
for (var i = 1; i <= 12; ++i) {
- var text;
- if (i < 10)
- text = '0' + i;
- else
- text = i;
+ var text = (i < 10 ? '0' : '') + i;
var option = document.createElement('option');
- option.text = text;
- option.value = text;
+ option.text = option.value = text;
expirationMonth.add(option, null);
}
@@ -131,7 +126,7 @@ cr.define('options', function() {
for (var i = 0; i < 10; ++i) {
var text = year + i;
var option = document.createElement('option');
- option.text = text;
+ option.text = String(text);
option.value = text;
expirationYear.add(option, null);
}
@@ -153,6 +148,7 @@ cr.define('options', function() {
/**
* Sets the value of each input field according to |creditCard|
+ * @param {CreditCardData} creditCard
* @private
*/
setInputFields_: function(creditCard) {
@@ -168,7 +164,7 @@ cr.define('options', function() {
var idx = parseInt(creditCard.expirationMonth, 10);
$('expiration-month').selectedIndex = idx - 1;
- expYear = creditCard.expirationYear;
+ var expYear = creditCard.expirationYear;
var date = new Date();
var year = parseInt(date.getFullYear(), 10);
for (var i = 0; i < 10; ++i) {
@@ -190,6 +186,7 @@ cr.define('options', function() {
/**
* Loads the credit card data from |creditCard|, sets the input fields based
* on this data and stores the GUID of the credit card.
+ * @param {CreditCardData} creditCard
* @private
*/
loadCreditCard_: function(creditCard) {

Powered by Google App Engine
This is Rietveld 408576698