MCPcopy Index your code
hub / github.com/nodejs/node / makeNodeErrorForHideStackFrame

Function makeNodeErrorForHideStackFrame

lib/internal/errors.js:411–432  ·  view source on GitHub ↗
(Base, clazz)

Source from the content-addressed store, hash-verified

409}
410
411function makeNodeErrorForHideStackFrame(Base, clazz) {
412 class HideStackFramesError extends Base {
413 constructor(...args) {
414 if (isErrorStackTraceLimitWritable()) {
415 const limit = Error.stackTraceLimit;
416 Error.stackTraceLimit = 0;
417 super(...args);
418 Error.stackTraceLimit = limit;
419 } else {
420 super(...args);
421 }
422 }
423
424 // This is a workaround for wpt tests that expect that the error
425 // constructor has a `name` property of the base class.
426 get ['constructor']() {
427 return clazz;
428 }
429 }
430
431 return HideStackFramesError;
432}
433
434function makeNodeErrorWithCode(Base, key) {
435 const msg = messages.get(key);

Callers 1

EFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…