diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-06-14 23:07:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-15 00:07:02 +0200 |
commit | 78b12a43b307c3405cd63cf4612517210330b487 (patch) | |
tree | ef9a6a258f13f7d4151e8152ed9702572126c165 /ext/node/polyfills/internal/errors.ts | |
parent | 184a85eaecbe7055b5b3969391f49c4723ac44fb (diff) |
fix(ext/node): better support for `node:diagnostics_channel` module (#24088)
Closes https://github.com/denoland/deno/issues/24060
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)}`); } |