diff options
Diffstat (limited to 'ext/node/polyfills/internal/errors.ts')
-rw-r--r-- | ext/node/polyfills/internal/errors.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/node/polyfills/internal/errors.ts b/ext/node/polyfills/internal/errors.ts index a16656087..cb4119411 100644 --- a/ext/node/polyfills/internal/errors.ts +++ b/ext/node/polyfills/internal/errors.ts @@ -349,9 +349,8 @@ export class NodeErrorAbstraction extends Error { super(message); this.code = code; this.name = name; - //This number changes depending on the name of this class - //20 characters as of now - this.stack = this.stack && `${name} [${this.code}]${this.stack.slice(20)}`; + this.stack = this.stack && + `${name} [${this.code}]${this.stack.slice(this.name.length)}`; } override toString() { @@ -614,7 +613,6 @@ export class ERR_INVALID_ARG_TYPE_RANGE extends NodeRangeError { export class ERR_INVALID_ARG_TYPE extends NodeTypeError { constructor(name: string, expected: string | string[], actual: unknown) { const msg = createInvalidArgType(name, expected); - super("ERR_INVALID_ARG_TYPE", `${msg}.${invalidArgTypeHelper(actual)}`); } |