1// Builds the window "error" listener used in controllers/index.js. 2// 3// The guard makes the handler re-entrance safe: if logging the error 4// synchronously triggers another error event (possible on a nearly 5// exhausted stack, where any extra work can overflow again), the nested 6// invocation bails out instead of recursing. 7 8export function createWindowErrorHandler() { 9 let handling = false; 10 11 return function handleWindowError(event) { 12 if (handling) return; 13 handling = true; 14 try { 15 if (event.error instanceof Error) { 16 console.warn("Uncaught error:", event.error.message, event.error.stack); 17 } 18 } finally { 19 handling = false; 20 } 21 }; 22};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.