Skip to content

Commit bcc5530

Browse files
committed
add missing file
1 parent 15abee8 commit bcc5530

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)