* Attempts to stringify a value, falling back to String. * @param {*} value * @return {string}
(value)
| 115 | * @return {string} |
| 116 | */ |
| 117 | function tryJsonStringify(value) { |
| 118 | try { |
| 119 | // Cast is fine, because we really don't care here. Just trying. |
| 120 | return JSON.stringify(/** @type {!JsonObject} */ (value)); |
| 121 | } catch (e) { |
| 122 | return String(value); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * @param {!Window} win |
no test coverage detected