elliott/hydratable
Elliott Johnson 2 days ago
parent 9c88438e58
commit 0c34711b29

@ -1,4 +1,4 @@
import { define_property } from './utils';
import { define_property } from './utils.js';
/**
* @param {string} label
@ -6,9 +6,12 @@ import { define_property } from './utils';
* @returns {Error & { stack: string } | null}
*/
export function get_infinite_stack(label, fn) {
// @ts-ignore - doesn't exist everywhere
const limit = Error.stackTraceLimit;
// @ts-ignore - doesn't exist everywhere
Error.stackTraceLimit = Infinity;
let error = Error();
// @ts-ignore - doesn't exist everywhere
Error.stackTraceLimit = limit;
const stack = fn(error.stack);

Loading…
Cancel
Save