@@ -2,6 +2,7 @@ import { getCurrentHub, withScope } from '@sentry/core';
2
2
import { Mechanism , SentryEvent , SentryWrappedFunction } from '@sentry/types' ;
3
3
import { isFunction } from '@sentry/utils/is' ;
4
4
import { htmlTreeAsString } from '@sentry/utils/misc' ;
5
+ import { serializeObject } from '@sentry/utils/object' ;
5
6
6
7
const debounceDuration : number = 1000 ;
7
8
let keypressTimeout : number | undefined ;
@@ -61,12 +62,14 @@ export function wrap(
61
62
before . apply ( this , arguments ) ;
62
63
}
63
64
65
+ const args = Array . prototype . slice . call ( arguments ) ;
66
+
64
67
try {
65
68
// Attempt to invoke user-land function
66
69
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
67
70
// means Raven caught an error invoking your application code. This is
68
71
// expected behavior and NOT indicative of a bug with Raven.js.
69
- const wrappedArguments = Array . prototype . slice . call ( arguments ) . map ( ( arg : any ) => wrap ( arg , options ) ) ;
72
+ const wrappedArguments = args . map ( ( arg : any ) => wrap ( arg , options ) ) ;
70
73
71
74
if ( fn . handleEvent ) {
72
75
return fn . handleEvent . apply ( this , wrappedArguments ) ;
@@ -85,6 +88,11 @@ export function wrap(
85
88
processedEvent . exception . mechanism = options . mechanism ;
86
89
}
87
90
91
+ processedEvent . extra = {
92
+ ...processedEvent . extra ,
93
+ arguments : serializeObject ( args , 2 ) ,
94
+ } ;
95
+
88
96
return processedEvent ;
89
97
} ) ;
90
98
0 commit comments