Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors: do not access .stack in debug #42096

Merged
merged 1 commit into from Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/source_map/prepare_stack_trace.js
Expand Up @@ -106,7 +106,7 @@ const prepareStackTrace = (globalThis, error, trace) => {
}
}
} catch (err) {
debug(err.stack);
debug(err);
}
return `${str}${t}`;
}), '');
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/source_map/source_map_cache.js
Expand Up @@ -79,7 +79,7 @@ function maybeCacheSourceMap(filename, content, cjsModuleInstance) {
} catch (err) {
// This is most likely an [eval]-wrapper, which is currently not
// supported.
debug(err.stack);
debug(err);
return;
}
const match = StringPrototypeMatch(
Expand Down Expand Up @@ -119,7 +119,7 @@ function dataFromUrl(sourceURL, sourceMappingURL) {
return null;
}
} catch (err) {
debug(err.stack);
debug(err);
// If no scheme is present, we assume we are dealing with a file path.
const mapURL = new URL(sourceMappingURL, sourceURL).href;
return sourceMapFromFile(mapURL);
Expand All @@ -144,7 +144,7 @@ function sourceMapFromFile(mapURL) {
const data = JSONParse(content);
return sourcesToAbsolute(mapURL, data);
} catch (err) {
debug(err.stack);
debug(err);
return null;
}
}
Expand All @@ -163,7 +163,7 @@ function sourceMapFromDataUrl(sourceURL, url) {
const parsedData = JSONParse(decodedData);
return sourcesToAbsolute(sourceURL, parsedData);
} catch (err) {
debug(err.stack);
debug(err);
return null;
}
} else {
Expand Down