Files
NapCatQQ/.pnpm-store/v3/files/67/ec06134e60121660f73a91b0f4dc68f74264011afef372c40ec6d52a366f3c0992d40d92a9bcfd0145248e3ab6f5cec2156fa7a543496dc39325ffe1a7b532
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

20 lines
921 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStackOverflowError = isStackOverflowError;
function isStackOverflowError(error) {
if (!(error instanceof Error)) {
return false;
}
// V8 (Chrome, Node.js, Edge, Deno): "Maximum call stack size exceeded"
// SpiderMonkey (Firefox): "too much recursion"
// JavaScriptCore (Safari): "call stack size exceeded"
// Chakra (IE/legacy Edge): "Out of stack space"
const stackOverflowPatterns = /stack space|call stack|too much recursion/i;
return (
// V8 and JavaScriptCore typically throw RangeError
(error instanceof RangeError &&
stackOverflowPatterns.test(error.message)) ||
// SpiderMonkey throws InternalError with "too much recursion"
(error.name === 'InternalError' && /too much recursion/.test(error.message)));
}
//# sourceMappingURL=isStackOverflowError.js.map