Skip to content

Commit

Permalink
remove cleanStackLine
Browse files Browse the repository at this point in the history
I'm not sure what the point of this was.
Testing locally, they all seem to work
without it.
  • Loading branch information
greggman committed Aug 4, 2024
1 parent b556f5c commit cb966c9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,10 @@ export function collectObjects(state, type) {
return list;
}

function cleanStackLine(line) {
return line.replace(/^\s*at\s+/, '');
}

export function getStackTrace() {
const stack = (new Error()).stack;
const lines = stack.split('\n');
// Remove the first two entries, the error message and this function itself, or the webgl-memory itself.
const userLines = lines.slice(2).filter((l) => !l.includes('webgl-memory'));
return userLines.map((l) => cleanStackLine(l));
const userLines = lines.slice(2).filter((l) => !l.includes('webgl-memory.js'));
return userLines.join('\n');
}

0 comments on commit cb966c9

Please sign in to comment.