* Converts IE11 CryptoOperation type to a Promise. * @param {Object} op * @return {!Promise}
(op)
| 84 | * @return {!Promise} |
| 85 | */ |
| 86 | function wrapCryptoOp(op) { |
| 87 | if (typeof op.then == 'function') { |
| 88 | return op; |
| 89 | } |
| 90 | return new Promise((resolve, reject) => { |
| 91 | op.oncomplete = (e) => { |
| 92 | resolve(op.result); |
| 93 | }; |
| 94 | op.onerror = reject; |
| 95 | }); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Interpret a byte array as a UTF-8 string. |
no test coverage detected