function getStack(error, skip = false) {
		if (error === null) {
			error = new Error();
		}
		let stack = error.stack.split("\n");
		if (!skip) stack.splice(1, 1);
		let regExecRes = /<(.*)>:(\d+):(\d+)/.exec(stack[1]) || [];
		if (!regExecRes.length) {
			const errorInfo = stack[1]?.split("/").pop();
			regExecRes = /(.+):(\d+):(\d+)/.exec(errorInfo) || [];
		}
		let src = "";
		const location = regExecRes[1];
		const lineno = regExecRes[2];
		const colno = regExecRes[3];

		if (location && lineno) {
			src = escapeHTML(`${location} ${lineno}${colno ? ":" + colno : ""}`);
		} else {
			const res = /\((.*)\)/.exec(stack[1]);
			src = res && res[1] ? res[1] : "";
		}
		const index = src.indexOf(")");
		src = src
			.split("/")
			.pop()
			.substring(0, index < 0 ? undefined : index);
		if (src.length > 50) src = "..." + src.substring(src.length - 50);

		return {
			location: src,
			stack: stack.join("\n"),
		};
	}
Gets the stack trace of the current call
@param {Error} error
@returns