@@ -2,6 +2,7 @@ import { getCurrentHub, withScope } from '@sentry/core';
22import { Mechanism , SentryEvent , SentryWrappedFunction } from '@sentry/types' ;
33import { isFunction } from '@sentry/utils/is' ;
44import { htmlTreeAsString } from '@sentry/utils/misc' ;
5+ import { serializeObject } from '@sentry/utils/object' ;
56
67const debounceDuration : number = 1000 ;
78let keypressTimeout : number | undefined ;
@@ -61,12 +62,14 @@ export function wrap(
6162 before . apply ( this , arguments ) ;
6263 }
6364
65+ const args = Array . prototype . slice . call ( arguments ) ;
66+
6467 try {
6568 // Attempt to invoke user-land function
6669 // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
6770 // means Raven caught an error invoking your application code. This is
6871 // 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 ) ) ;
7073
7174 if ( fn . handleEvent ) {
7275 return fn . handleEvent . apply ( this , wrappedArguments ) ;
@@ -85,6 +88,11 @@ export function wrap(
8588 processedEvent . exception . mechanism = options . mechanism ;
8689 }
8790
91+ processedEvent . extra = {
92+ ...processedEvent . extra ,
93+ arguments : serializeObject ( args , 2 ) ,
94+ } ;
95+
8896 return processedEvent ;
8997 } ) ;
9098
0 commit comments