@cloudcare/browser-core 1.1.3 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/cjs/{cookie.js → browser/cookie.js} +6 -37
  2. package/cjs/browser/fetchObservable.js +91 -0
  3. package/cjs/browser/xhrObservable.js +118 -0
  4. package/cjs/configuration/configuration.js +70 -0
  5. package/cjs/configuration/transportConfiguration.js +64 -0
  6. package/cjs/console/consoleObservable.js +84 -0
  7. package/cjs/dataMap.js +26 -21
  8. package/cjs/error/trackRuntimeError.js +27 -0
  9. package/cjs/helper/catchUserErrors.js +20 -0
  10. package/cjs/helper/contextHistory.js +134 -0
  11. package/cjs/helper/createEventRateLimiter.js +47 -0
  12. package/cjs/helper/deviceInfo.js +8 -25
  13. package/cjs/helper/display.js +31 -0
  14. package/cjs/helper/enums.js +28 -2
  15. package/cjs/helper/errorTools.js +63 -2
  16. package/cjs/helper/instrumentMethod.js +93 -0
  17. package/cjs/helper/lifeCycle.js +5 -3
  18. package/cjs/helper/observable.js +40 -2
  19. package/cjs/helper/tools.js +185 -9
  20. package/cjs/index.js +153 -23
  21. package/cjs/init.js +17 -27
  22. package/cjs/report/reportObservable.js +112 -0
  23. package/cjs/session/sessionConstants.js +13 -0
  24. package/cjs/session/sessionCookieStore.js +188 -0
  25. package/cjs/session/sessionManagement.js +96 -0
  26. package/cjs/session/sessionStore.js +150 -0
  27. package/cjs/synthetics/syntheticsWorkerValues.js +32 -0
  28. package/cjs/synthetics/usr.js +32 -0
  29. package/cjs/tracekit/computeStackTrace.js +73 -563
  30. package/cjs/tracekit/index.js +3 -15
  31. package/cjs/tracekit/tracekit.js +113 -0
  32. package/cjs/transport/batch.js +332 -0
  33. package/cjs/transport/httpRequest.js +112 -0
  34. package/cjs/transport/index.js +29 -0
  35. package/cjs/transport/sendWithRetryStrategy.js +177 -0
  36. package/cjs/transport/startBatchWithReplica.js +24 -0
  37. package/esm/{cookie.js → browser/cookie.js} +4 -35
  38. package/esm/browser/fetchObservable.js +77 -0
  39. package/esm/browser/xhrObservable.js +106 -0
  40. package/esm/configuration/configuration.js +55 -0
  41. package/esm/configuration/transportConfiguration.js +54 -0
  42. package/esm/console/consoleObservable.js +70 -0
  43. package/esm/dataMap.js +26 -21
  44. package/esm/error/trackRuntimeError.js +16 -0
  45. package/esm/helper/catchUserErrors.js +12 -0
  46. package/esm/helper/contextHistory.js +106 -0
  47. package/esm/helper/createEventRateLimiter.js +38 -0
  48. package/esm/helper/deviceInfo.js +6 -25
  49. package/esm/helper/display.js +21 -0
  50. package/esm/helper/enums.js +25 -1
  51. package/esm/helper/errorTools.js +58 -3
  52. package/esm/helper/instrumentMethod.js +81 -0
  53. package/esm/helper/lifeCycle.js +5 -3
  54. package/esm/helper/observable.js +39 -3
  55. package/esm/helper/tools.js +147 -1
  56. package/esm/index.js +17 -7
  57. package/esm/init.js +17 -22
  58. package/esm/report/reportObservable.js +98 -0
  59. package/esm/session/sessionConstants.js +3 -0
  60. package/esm/session/sessionCookieStore.js +168 -0
  61. package/esm/session/sessionManagement.js +78 -0
  62. package/esm/session/sessionStore.js +139 -0
  63. package/esm/synthetics/syntheticsWorkerValues.js +15 -0
  64. package/esm/synthetics/usr.js +18 -0
  65. package/esm/tracekit/computeStackTrace.js +73 -557
  66. package/esm/tracekit/index.js +1 -1
  67. package/esm/tracekit/tracekit.js +103 -0
  68. package/esm/transport/batch.js +316 -0
  69. package/esm/transport/httpRequest.js +104 -0
  70. package/esm/transport/index.js +3 -0
  71. package/esm/transport/sendWithRetryStrategy.js +165 -0
  72. package/esm/transport/startBatchWithReplica.js +15 -0
  73. package/package.json +2 -2
  74. package/src/.DS_Store +0 -0
  75. package/src/{cookie.js → browser/cookie.js} +6 -34
  76. package/src/browser/fetchObservable.js +86 -0
  77. package/src/browser/xhrObservable.js +102 -0
  78. package/src/configuration/configuration.js +61 -0
  79. package/src/configuration/transportConfiguration.js +42 -0
  80. package/src/console/consoleObservable.js +65 -0
  81. package/src/dataMap.js +26 -21
  82. package/src/error/trackRuntimeError.js +19 -0
  83. package/src/helper/catchUserErrors.js +12 -0
  84. package/src/helper/contextHistory.js +85 -0
  85. package/src/helper/createEventRateLimiter.js +37 -0
  86. package/src/helper/deviceInfo.js +5 -51
  87. package/src/helper/display.js +21 -0
  88. package/src/helper/enums.js +38 -14
  89. package/src/helper/errorTools.js +76 -12
  90. package/src/helper/instrumentMethod.js +97 -0
  91. package/src/helper/lifeCycle.js +5 -3
  92. package/src/helper/observable.js +33 -2
  93. package/src/helper/tools.js +135 -4
  94. package/src/index.js +18 -7
  95. package/src/init.js +17 -18
  96. package/src/report/reportObservable.js +113 -0
  97. package/src/session/sessionConstants.js +3 -0
  98. package/src/session/sessionCookieStore.js +159 -0
  99. package/src/session/sessionManagement.js +89 -0
  100. package/src/session/sessionStore.js +139 -0
  101. package/src/synthetics/syntheticsWorkerValues.js +22 -0
  102. package/src/synthetics/usr.js +18 -0
  103. package/src/tracekit/computeStackTrace.js +75 -551
  104. package/src/tracekit/index.js +1 -1
  105. package/src/tracekit/tracekit.js +100 -0
  106. package/src/transport/batch.js +289 -0
  107. package/src/transport/httpRequest.js +109 -0
  108. package/src/transport/index.js +3 -0
  109. package/src/transport/sendWithRetryStrategy.js +186 -0
  110. package/src/transport/startBatchWithReplica.js +26 -0
  111. package/cjs/configuration.js +0 -193
  112. package/cjs/errorCollection.js +0 -167
  113. package/cjs/fetchProxy.js +0 -161
  114. package/cjs/helper/errorFilter.js +0 -47
  115. package/cjs/sessionManagement.js +0 -221
  116. package/cjs/tracekit/report.js +0 -289
  117. package/cjs/transport.js +0 -373
  118. package/cjs/xhrProxy.js +0 -122
  119. package/esm/configuration.js +0 -176
  120. package/esm/errorCollection.js +0 -141
  121. package/esm/fetchProxy.js +0 -115
  122. package/esm/helper/errorFilter.js +0 -38
  123. package/esm/sessionManagement.js +0 -195
  124. package/esm/tracekit/report.js +0 -273
  125. package/esm/transport.js +0 -357
  126. package/esm/xhrProxy.js +0 -110
  127. package/src/configuration.js +0 -161
  128. package/src/errorCollection.js +0 -170
  129. package/src/fetchProxy.js +0 -108
  130. package/src/helper/errorFilter.js +0 -38
  131. package/src/sessionManagement.js +0 -224
  132. package/src/tracekit/report.js +0 -284
  133. package/src/transport.js +0 -380
  134. package/src/xhrProxy.js +0 -106
@@ -1,224 +0,0 @@
1
- import { cacheCookieAccess, COOKIE_ACCESS_DELAY } from './cookie'
2
- import { Observable } from './helper/observable'
3
- import {
4
- ONE_MINUTE,
5
- ONE_HOUR,
6
- throttle,
7
- UUID,
8
- isEmptyObject,
9
- objectEntries,
10
- addEventListener,
11
- addEventListeners,
12
- each
13
- } from './helper/tools'
14
- import { DOM_EVENT } from './helper/enums'
15
-
16
- export var SESSION_COOKIE_NAME = '_dataflux_s'
17
- export var SESSION_EXPIRATION_DELAY = 15 * ONE_MINUTE
18
- export var SESSION_TIME_OUT_DELAY = 4 * ONE_HOUR
19
- export var VISIBILITY_CHECK_DELAY = ONE_MINUTE
20
- export var ANONYMOUS_ID_COOKIE_NAME = '_dataflulx_an_id'
21
- export var ANONYMOUS_ID_EXPIRATION = 60 * 24 * ONE_HOUR
22
- function cacheAnonymousID(options) {
23
- var anonymousCookie = cacheCookieAccess(ANONYMOUS_ID_COOKIE_NAME, options)
24
- var anonymouseId = anonymousCookie.get()
25
- if (!anonymouseId) {
26
- anonymousCookie.set(UUID(), ANONYMOUS_ID_EXPIRATION)
27
- }
28
- return anonymousCookie
29
- }
30
- /**
31
- * Limit access to cookie to avoid performance issues
32
- */
33
- export function startSessionManagement(
34
- options,
35
- productKey,
36
- computeSessionState
37
- ) {
38
- var anonymousCookie = cacheAnonymousID(options)
39
- var sessionCookie = cacheCookieAccess(SESSION_COOKIE_NAME, options)
40
- var renewObservable = new Observable()
41
- var currentSession = retrieveActiveSession(sessionCookie)
42
- var currentSessionId = currentSession.id
43
- var expandOrRenewSession = throttle(function () {
44
- sessionCookie.clearCache()
45
- var session = retrieveActiveSession(sessionCookie)
46
- var state = computeSessionState(session[productKey])
47
- session[productKey] = state.trackingType
48
- if (state.isTracked && !session.id) {
49
- session.id = UUID()
50
- session.created = String(Date.now())
51
- }
52
- // save changes and expand session duration
53
- persistSession(session, sessionCookie)
54
-
55
- // If the session id has changed, notify that the session has been renewed
56
- if (state.isTracked && currentSessionId !== session.id) {
57
- currentSessionId = session.id
58
- renewObservable.notify()
59
- }
60
- }, COOKIE_ACCESS_DELAY)
61
-
62
- var expandSession = function () {
63
- sessionCookie.clearCache()
64
- var session = retrieveActiveSession(sessionCookie)
65
- persistSession(session, sessionCookie)
66
- }
67
-
68
- expandOrRenewSession()
69
- trackActivity(expandOrRenewSession)
70
- trackVisibility(expandSession)
71
-
72
- return {
73
- getAnonymousID: function () {
74
- return anonymousCookie.get()
75
- },
76
- getId: function () {
77
- // 先获取debug id
78
- var session = retrieveActiveSession(sessionCookie)
79
- return session.did || session.id
80
- },
81
- getTrackingType: function () {
82
- return retrieveActiveSession(sessionCookie)[productKey]
83
- },
84
- getDebugSession: function () {
85
- var session = retrieveActiveSession(sessionCookie)
86
- if (isEmptyObject(session) || !session.did) {
87
- return {}
88
- }
89
- return {
90
- id: session.did,
91
- created: session.dcreated
92
- }
93
- },
94
- addDebugSession: function (id, created) {
95
- var session = retrieveActiveSession(sessionCookie)
96
- if (!isEmptyObject(session)) {
97
- session.did = id || UUID
98
- session.dcreated = created || String(Date.now())
99
- persistSession(session, sessionCookie)
100
- }
101
- },
102
- clearDebugSession: function () {
103
- var session = retrieveActiveSession(sessionCookie)
104
- var newSession = {}
105
- each(objectEntries(session), function (item) {
106
- if (item[0] !== 'did' && item[0] !== 'dcreated') {
107
- newSession[item[0]] = item[1]
108
- }
109
- })
110
- persistSession(newSession, sessionCookie)
111
- },
112
- renewObservable: renewObservable
113
- }
114
- }
115
-
116
- var SESSION_ENTRY_REGEXP = /^([a-z]+)=([a-z0-9-]+)$/
117
-
118
- var SESSION_ENTRY_SEPARATOR = '&'
119
- export function isValidSessionString(sessionString) {
120
- return (
121
- sessionString !== undefined &&
122
- (sessionString.indexOf(SESSION_ENTRY_SEPARATOR) !== -1 ||
123
- SESSION_ENTRY_REGEXP.test(sessionString))
124
- )
125
- }
126
-
127
- function retrieveActiveSession(sessionCookie) {
128
- var session = retrieveSession(sessionCookie)
129
- if (isActiveSession(session)) {
130
- return session
131
- }
132
- clearSession(sessionCookie)
133
- return {}
134
- }
135
-
136
- function isActiveSession(session) {
137
- return (
138
- (session.created === undefined ||
139
- Date.now() - Number(session.created) < SESSION_TIME_OUT_DELAY) &&
140
- (session.expire === undefined || Date.now() < Number(session.expire))
141
- )
142
- }
143
-
144
- function retrieveSession(sessionCookie) {
145
- var sessionString = sessionCookie.get()
146
- var session = {}
147
- if (isValidSessionString(sessionString)) {
148
- each(sessionString.split(SESSION_ENTRY_SEPARATOR), function (entry) {
149
- var matches = SESSION_ENTRY_REGEXP.exec(entry)
150
- if (matches !== null) {
151
- var key = matches[1]
152
- var value = matches[2]
153
- session[key] = value
154
- }
155
- })
156
- }
157
- return session
158
- }
159
-
160
- export function persistSession(session, cookie) {
161
- if (isEmptyObject(session)) {
162
- clearSession(cookie)
163
- return
164
- }
165
- session.expire = String(Date.now() + SESSION_EXPIRATION_DELAY)
166
- var cookieArray = []
167
- each(objectEntries(session), function (item) {
168
- cookieArray.push(item[0] + '=' + item[1])
169
- })
170
- var cookieString = cookieArray.join(SESSION_ENTRY_SEPARATOR)
171
- cookie.set(cookieString, SESSION_EXPIRATION_DELAY)
172
- }
173
-
174
- function clearSession(cookie) {
175
- cookie.set('', 0)
176
- }
177
-
178
- export function stopSessionManagement() {
179
- each(stopCallbacks, function (e) {
180
- e()
181
- })
182
-
183
- stopCallbacks = []
184
- }
185
-
186
- var stopCallbacks = []
187
-
188
- export function trackActivity(expandOrRenewSession) {
189
- var listeners = addEventListeners(
190
- window,
191
- [
192
- DOM_EVENT.CLICK,
193
- DOM_EVENT.TOUCH_START,
194
- DOM_EVENT.KEY_DOWN,
195
- DOM_EVENT.SCROLL
196
- ],
197
- expandOrRenewSession,
198
- { capture: true, passive: true }
199
- )
200
- stopCallbacks.push(listeners.stop)
201
- }
202
-
203
- function trackVisibility(expandSession) {
204
- var expandSessionWhenVisible = function () {
205
- if (document.visibilityState === 'visible') {
206
- expandSession()
207
- }
208
- }
209
-
210
- var listener = addEventListener(
211
- document,
212
- DOM_EVENT.VISIBILITY_CHANGE,
213
- expandSessionWhenVisible
214
- )
215
- stopCallbacks.push(listener.stop)
216
-
217
- var visibilityCheckInterval = window.setInterval(
218
- expandSessionWhenVisible,
219
- VISIBILITY_CHECK_DELAY
220
- )
221
- stopCallbacks.push(function () {
222
- clearInterval(visibilityCheckInterval)
223
- })
224
- }
@@ -1,284 +0,0 @@
1
- import {
2
- computeStackTrace,
3
- augmentStackTraceWithInitialElement
4
- } from './computeStackTrace'
5
- import { each } from '../helper/tools'
6
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
7
- // eslint-disable-next-line max-len
8
- var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/
9
-
10
- /**
11
- * Cross-browser processing of unhandled exceptions
12
- *
13
- * Syntax:
14
- * ```js
15
- * subscribe(function(stackInfo) { ... })
16
- * unsubscribe(function(stackInfo) { ... })
17
- * report(exception)
18
- * try { ...code... } catch(ex) { report(ex); }
19
- * ```
20
- *
21
- * Supports:
22
- * - Firefox: full stack trace with line numbers, plus column number
23
- * on top frame; column number is not guaranteed
24
- * - Opera: full stack trace with line and column numbers
25
- * - Chrome: full stack trace with line and column numbers
26
- * - Safari: line and column number for the top frame only; some frames
27
- * may be missing, and column number is not guaranteed
28
- * - IE: line and column number for the top frame only; some frames
29
- * may be missing, and column number is not guaranteed
30
- *
31
- * In theory, TraceKit should work on all of the following versions:
32
- * - IE5.5+ (only 8.0 tested)
33
- * - Firefox 0.9+ (only 3.5+ tested)
34
- * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
35
- * Exceptions Have Stacktrace to be enabled in opera:config)
36
- * - Safari 3+ (only 4+ tested)
37
- * - Chrome 1+ (only 5+ tested)
38
- * - Konqueror 3.5+ (untested)
39
- *
40
- * Requires computeStackTrace.
41
- *
42
- * Tries to catch all unhandled exceptions and report them to the
43
- * subscribed handlers. Please note that report will rethrow the
44
- * exception. This is REQUIRED in order to get a useful stack trace in IE.
45
- * If the exception does not reach the top of the browser, you will only
46
- * get a stack trace from the point where report was called.
47
- *
48
- * Handlers receive a StackTrace object as described in the
49
- * computeStackTrace docs.
50
- *
51
- * @memberof TraceKit
52
- * @namespace
53
- */
54
-
55
- /**
56
- * Reports an unhandled Error.
57
- * @param {Error} ex
58
- * @memberof report
59
- * @throws An exception if an incomplete stack trace is detected (old IE browsers).
60
- */
61
- export function report(ex) {
62
- if (lastExceptionStack) {
63
- if (lastException === ex) {
64
- return // already caught by an inner catch block, ignore
65
- }
66
- processLastException()
67
- }
68
-
69
- var stack = computeStackTrace(ex)
70
- lastExceptionStack = stack
71
- lastException = ex
72
-
73
- // If the stack trace is incomplete, wait for 2 seconds for
74
- // slow slow IE to see if onerror occurs or not before reporting
75
- // this exception; otherwise, we will end up with an incomplete
76
- // stack trace
77
- setTimeout(
78
- function () {
79
- if (lastException === ex) {
80
- processLastException()
81
- }
82
- },
83
- stack.incomplete ? 2000 : 0
84
- )
85
- throw ex // re-throw to propagate to the top level (and cause window.onerror)
86
- }
87
-
88
- var handlers = []
89
- var lastException
90
- var lastExceptionStack
91
-
92
- /**
93
- * Add a crash handler.
94
- * @param {Function} handler
95
- * @memberof report
96
- */
97
- export function subscribe(handler) {
98
- installGlobalHandler()
99
- installGlobalUnhandledRejectionHandler()
100
- handlers.push(handler)
101
- }
102
-
103
- /**
104
- * Remove a crash handler.
105
- * @param {Function} handler
106
- * @memberof report
107
- */
108
- export function unsubscribe(handler) {
109
- for (var i = handlers.length - 1; i >= 0; i -= 1) {
110
- if (handlers[i] === handler) {
111
- handlers.splice(i, 1)
112
- }
113
- }
114
-
115
- if (handlers.length === 0) {
116
- uninstallGlobalHandler()
117
- uninstallGlobalUnhandledRejectionHandler()
118
- }
119
- }
120
-
121
- /**
122
- * Dispatch stack information to all handlers.
123
- * @param {StackTrace} stack
124
- * @param {boolean} isWindowError Is this a top-level window error?
125
- * @param {Error=} error The error that's being handled (if available, null otherwise)
126
- * @memberof report
127
- * @throws An exception if an error occurs while calling an handler.
128
- */
129
- function notifyHandlers(stack, isWindowError, error) {
130
- var exception
131
- each(handlers, function (handler) {
132
- try {
133
- handler(stack, isWindowError, error)
134
- } catch (inner) {
135
- exception = inner
136
- }
137
- })
138
-
139
- if (exception) {
140
- throw exception
141
- }
142
- }
143
-
144
- var oldOnerrorHandler
145
- var onErrorHandlerInstalled
146
- var oldOnunhandledrejectionHandler
147
- var onUnhandledRejectionHandlerInstalled
148
-
149
- /**
150
- * Ensures all global unhandled exceptions are recorded.
151
- * Supported by Gecko and IE.
152
- * @param {Event|string} message Error message.
153
- * @param {string=} url URL of script that generated the exception.
154
- * @param {(number|string)=} lineNo The line number at which the error occurred.
155
- * @param {(number|string)=} columnNo The column number at which the error occurred.
156
- * @param {Error=} errorObj The actual Error object.
157
- * @memberof report
158
- */
159
- export function traceKitWindowOnError(
160
- message,
161
- url,
162
- lineNo,
163
- columnNo,
164
- errorObj
165
- ) {
166
- var stack
167
-
168
- if (lastExceptionStack) {
169
- augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo)
170
- processLastException()
171
- } else if (errorObj) {
172
- stack = computeStackTrace(errorObj)
173
- notifyHandlers(stack, true, errorObj)
174
- } else {
175
- var location = {
176
- url: url,
177
- column: columnNo,
178
- line: lineNo
179
- }
180
-
181
- var name
182
- var msg = message
183
- if ({}.toString.call(message) === '[object String]') {
184
- var groups = ERROR_TYPES_RE.exec(msg)
185
- if (groups) {
186
- name = groups[1]
187
- msg = groups[2]
188
- }
189
- }
190
-
191
- stack = {
192
- name: name,
193
- message: typeof msg === 'string' ? msg : undefined,
194
- stack: [location]
195
- }
196
-
197
- notifyHandlers(stack, true, message)
198
- }
199
-
200
- if (oldOnerrorHandler) {
201
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
202
- return oldOnerrorHandler.apply(this, arguments)
203
- }
204
-
205
- return false
206
- }
207
-
208
- /**
209
- * Ensures all unhandled rejections are recorded.
210
- * @param {PromiseRejectionEvent} e event.
211
- * @memberof report
212
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onunhandledrejection
213
- * @see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
214
- */
215
- function traceKitWindowOnUnhandledRejection(e) {
216
- var reason = e.reason || 'Empty reason'
217
- var stack = computeStackTrace(reason)
218
- notifyHandlers(stack, true, reason)
219
- }
220
-
221
- /**
222
- * Install a global onerror handler
223
- * @memberof report
224
- */
225
- function installGlobalHandler() {
226
- if (onErrorHandlerInstalled) {
227
- return
228
- }
229
-
230
- oldOnerrorHandler = window.onerror
231
- window.onerror = traceKitWindowOnError
232
- onErrorHandlerInstalled = true
233
- }
234
-
235
- /**
236
- * Uninstall the global onerror handler
237
- * @memberof report
238
- */
239
- function uninstallGlobalHandler() {
240
- if (onErrorHandlerInstalled) {
241
- window.onerror = oldOnerrorHandler
242
- onErrorHandlerInstalled = false
243
- }
244
- }
245
-
246
- /**
247
- * Install a global onunhandledrejection handler
248
- * @memberof report
249
- */
250
- function installGlobalUnhandledRejectionHandler() {
251
- if (onUnhandledRejectionHandlerInstalled) {
252
- return
253
- }
254
-
255
- oldOnunhandledrejectionHandler =
256
- window.onunhandledrejection !== null
257
- ? window.onunhandledrejection
258
- : undefined
259
- window.onunhandledrejection = traceKitWindowOnUnhandledRejection
260
- onUnhandledRejectionHandlerInstalled = true
261
- }
262
-
263
- /**
264
- * Uninstall the global onunhandledrejection handler
265
- * @memberof report
266
- */
267
- function uninstallGlobalUnhandledRejectionHandler() {
268
- if (onUnhandledRejectionHandlerInstalled) {
269
- window.onunhandledrejection = oldOnunhandledrejectionHandler
270
- onUnhandledRejectionHandlerInstalled = false
271
- }
272
- }
273
-
274
- /**
275
- * Process the most recent exception
276
- * @memberof report
277
- */
278
- function processLastException() {
279
- var currentLastExceptionStack = lastExceptionStack
280
- var currentLastException = lastException
281
- lastExceptionStack = undefined
282
- lastException = undefined
283
- notifyHandlers(currentLastExceptionStack, false, currentLastException)
284
- }