MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / gecko

Function gecko

packages/browser/src/stack-parsers.ts:123–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
122
123const gecko: StackLineParserFn = line => {
124 const parts = geckoREgex.exec(line) as null | [string, string, string, string, string, string];
125
126 if (parts) {
127 const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
128 if (isEval) {
129 const subMatch = geckoEvalRegex.exec(parts[3]) as null | [string, string, string];
130
131 if (subMatch) {
132 // throw out eval line/column and use top-most line number
133 parts[1] = parts[1] || 'eval';
134 parts[3] = subMatch[1];
135 parts[4] = subMatch[2];
136 parts[5] = ''; // no column when eval
137 }
138 }
139
140 let filename = parts[3];
141 let func = parts[1] || UNKNOWN_FUNCTION;
142 [func, filename] = extractSafariExtensionDetails(func, filename);
143
144 return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);
145 }
146
147 return;
148};
149
150export const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];
151

Callers

nothing calls this directly

Calls 3

createFrameFunction · 0.85
execMethod · 0.80

Tested by

no test coverage detected