diff --git a/packages/rrweb/src/utils.ts b/packages/rrweb/src/utils.ts index 782fd3dd8e..106097bf5e 100644 --- a/packages/rrweb/src/utils.ts +++ b/packages/rrweb/src/utils.ts @@ -163,6 +163,9 @@ export function patch( // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" if (typeof wrapped === 'function') { + wrapped.toString = function() { + return original.toString(); + }; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment wrapped.prototype = wrapped.prototype || {}; Object.defineProperties(wrapped, {