| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The Chromium Authors. All rights reserved. | 2 * Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Prints the message. | 8 * Prints the message. |
| 9 * @param {String} msg - The message to print. | 9 * @param {String} msg - The message to print. |
| 10 */ | 10 */ |
| 11 function print(msg) { // eslint-disable-line no-unused-vars | 11 function print(msg) { // eslint-disable-line no-unused-vars |
| 12 document.getElementById('result').innerHTML = msg; | 12 document.getElementById('result').innerHTML = msg; |
| 13 } | 13 } |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * Converts ShippingAddress into a dictionary. | 16 * Converts ShippingAddress into a dictionary. |
| 17 * @param {ShippingAddress} addr - The object to convert. | 17 * @param {ShippingAddress} addr - The object to convert. |
| 18 * @return {object} The dictionary output. | 18 * @return {object} The dictionary output. |
| 19 */ | 19 */ |
| 20 function toDictionary(addr) { // eslint-disable-line no-unused-vars | 20 function toDictionary(addr) { // eslint-disable-line no-unused-vars |
| 21 var dict = {}; | 21 var dict = {}; |
| 22 if (addr) { | 22 if (addr) { |
| 23 dict.regionCode = addr.regionCode; | 23 dict.country = addr.country; |
| 24 dict.administrativeArea = addr.administrativeArea; | 24 dict.region = addr.region; |
| 25 dict.locality = addr.locality; | 25 dict.city = addr.city; |
| 26 dict.dependentLocality = addr.dependentLocality; | 26 dict.dependentLocality = addr.dependentLocality; |
| 27 dict.addressLine = addr.addressLine; | 27 dict.addressLine = addr.addressLine; |
| 28 dict.postalCode = addr.postalCode; | 28 dict.postalCode = addr.postalCode; |
| 29 dict.sortingCode = addr.sortingCode; | 29 dict.sortingCode = addr.sortingCode; |
| 30 dict.languageCode = addr.languageCode; | 30 dict.languageCode = addr.languageCode; |
| 31 dict.organization = addr.organization; | 31 dict.organization = addr.organization; |
| 32 dict.recipient = addr.recipient; | 32 dict.recipient = addr.recipient; |
| 33 dict.careOf = addr.careOf; |
| 34 dict.phone = addr.phone; |
| 33 } | 35 } |
| 34 return dict; | 36 return dict; |
| 35 } | 37 } |
| OLD | NEW |