We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8434d8 commit 3c90b1aCopy full SHA for 3c90b1a
lib/internal/errors.js
@@ -81,7 +81,7 @@ const maybeOverridePrepareStackTrace = (globalThis, error, trace) => {
81
// https://crbug.com/v8/7848
82
// `globalThis` is the global that contains the constructor which
83
// created `error`.
84
- if (typeof globalThis.Error.prepareStackTrace === 'function') {
+ if (typeof globalThis.Error?.prepareStackTrace === 'function') {
85
return globalThis.Error.prepareStackTrace(error, trace);
86
}
87
// We still have legacy usage that depends on the main context's `Error`
0 commit comments