(fn, receiver, args)
| 92 | // WebCrypto methods return promises, including for synchronous validation |
| 93 | // failures. Keep that conversion in one place so method bodies stay readable. |
| 94 | function callSubtleCryptoMethod(fn, receiver, args) { |
| 95 | try { |
| 96 | const result = ReflectApply(fn, receiver, args); |
| 97 | if (isPromise(result)) |
| 98 | return result; |
| 99 | // PromiseResolve() performs thenable assimilation for object results. |
| 100 | // Shadow inherited then accessors while it resolves synchronous results. |
| 101 | const shouldCleanupResult = prepareWebCryptoResult(result); |
| 102 | try { |
| 103 | return PromiseResolve(result); |
| 104 | } finally { |
| 105 | if (shouldCleanupResult) |
| 106 | cleanupWebCryptoResult(result); |
| 107 | } |
| 108 | } catch (err) { |
| 109 | return PromiseReject(err); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | const kArgumentContexts = [ |
| 114 | '1st argument', |
no test coverage detected
searching dependent graphs…