Skip to content

Commit 2e1231b

Browse files
bcoesxa
authored andcommitted
errors: do not access .stack in debug
Refs: #41541 PR-URL: #42096 Refs: #41541 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Mestery <[email protected]>
1 parent ec4c0de commit 2e1231b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/internal/source_map/prepare_stack_trace.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const prepareStackTrace = (globalThis, error, trace) => {
106106
}
107107
}
108108
} catch (err) {
109-
debug(err.stack);
109+
debug(err);
110110
}
111111
return `${str}${t}`;
112112
}), '');

lib/internal/source_map/source_map_cache.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function maybeCacheSourceMap(filename, content, cjsModuleInstance) {
7979
} catch (err) {
8080
// This is most likely an [eval]-wrapper, which is currently not
8181
// supported.
82-
debug(err.stack);
82+
debug(err);
8383
return;
8484
}
8585
const match = StringPrototypeMatch(
@@ -119,7 +119,7 @@ function dataFromUrl(sourceURL, sourceMappingURL) {
119119
return null;
120120
}
121121
} catch (err) {
122-
debug(err.stack);
122+
debug(err);
123123
// If no scheme is present, we assume we are dealing with a file path.
124124
const mapURL = new URL(sourceMappingURL, sourceURL).href;
125125
return sourceMapFromFile(mapURL);
@@ -144,7 +144,7 @@ function sourceMapFromFile(mapURL) {
144144
const data = JSONParse(content);
145145
return sourcesToAbsolute(mapURL, data);
146146
} catch (err) {
147-
debug(err.stack);
147+
debug(err);
148148
return null;
149149
}
150150
}
@@ -163,7 +163,7 @@ function sourceMapFromDataUrl(sourceURL, url) {
163163
const parsedData = JSONParse(decodedData);
164164
return sourcesToAbsolute(sourceURL, parsedData);
165165
} catch (err) {
166-
debug(err.stack);
166+
debug(err);
167167
return null;
168168
}
169169
} else {

0 commit comments

Comments
 (0)