We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15abee8 commit bcc5530Copy full SHA for bcc5530
packages/next/src/client/components/react-dev-overlay/internal/helpers/capture-stack-trace.ts
@@ -0,0 +1,12 @@
1
+// Polyfill for `Error.captureStackTrace` in browsers
2
+export function captureStackTrace(obj: any) {
3
+ const container = new Error()
4
+ Object.defineProperty(obj, 'stack', {
5
+ configurable: true,
6
+ get() {
7
+ const { stack } = container
8
+ Object.defineProperty(this, 'stack', { value: stack })
9
+ return stack
10
+ },
11
+ })
12
+}
0 commit comments