Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1492 * @param {T} defaultValue | 1492 * @param {T} defaultValue |
| 1493 * @return {!Promise.<T>} | 1493 * @return {!Promise.<T>} |
| 1494 * @template T | 1494 * @template T |
| 1495 */ | 1495 */ |
| 1496 Promise.prototype.catchException = function(defaultValue) { | 1496 Promise.prototype.catchException = function(defaultValue) { |
| 1497 return this.catch(function (error) { | 1497 return this.catch(function (error) { |
| 1498 console.error(error); | 1498 console.error(error); |
| 1499 return defaultValue; | 1499 return defaultValue; |
| 1500 }); | 1500 }); |
| 1501 } | 1501 } |
| 1502 | |
| 1503 /** | |
| 1504 * @param {*} object | |
| 1505 * @param {*} propertyName | |
| 1506 * @param {T} result | |
| 1507 * @return {T} | |
| 1508 * @template T | |
| 1509 */ | |
| 1510 function storeResultTo(object, propertyName, result) { | |
|
pfeldman
2015/09/02 03:05:52
{ goes next line. not a fan of this since it is no
kozy
2015/09/02 16:34:04
Done.
| |
| 1511 object[propertyName] = result; | |
| 1512 return result; | |
| 1513 } | |
| OLD | NEW |