| 30 | // Create a namespace and attach function that will store captured exception |
| 31 | // Because functions are also objects, we can attach the queue itself straight to it and save some bytes |
| 32 | var queue = function(content) { |
| 33 | // content.e = error |
| 34 | // content.p = promise rejection |
| 35 | // content.f = function call the Sentry |
| 36 | if ( |
| 37 | ('e' in content || |
| 38 | 'p' in content || |
| 39 | (content.f?.indexOf('capture') > -1) || |
| 40 | (content.f?.indexOf('showReportDialog') > -1)) && |
| 41 | lazy |
| 42 | ) { |
| 43 | // We only want to lazy inject/load the sdk bundle if |
| 44 | // an error or promise rejection occurred |
| 45 | // OR someone called `capture...` on the SDK |
| 46 | injectSdk(onLoadCallbacks); |
| 47 | } |
| 48 | queue.data.push(content); |
| 49 | }; |
| 50 | queue.data = []; |
| 51 | |
| 52 | function injectSdk(callbacks) { |