From 8c4b33db0d05181a0e5538bddaf063144724c938 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 18 Jun 2024 16:16:13 +0530 Subject: feat(ext/node): add BlockList & SocketAddress classes (#24229) Closes https://github.com/denoland/deno/issues/24059 --- ext/node/polyfills/internal/errors.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'ext/node/polyfills/internal/errors.ts') diff --git a/ext/node/polyfills/internal/errors.ts b/ext/node/polyfills/internal/errors.ts index cb4119411..6529e9894 100644 --- a/ext/node/polyfills/internal/errors.ts +++ b/ext/node/polyfills/internal/errors.ts @@ -667,9 +667,7 @@ function invalidArgTypeHelper(input: any) { return ` Received type ${typeof input} (${inspected})`; } -export class ERR_OUT_OF_RANGE extends RangeError { - code = "ERR_OUT_OF_RANGE"; - +export class ERR_OUT_OF_RANGE extends NodeRangeError { constructor( str: string, range: string, @@ -694,15 +692,7 @@ export class ERR_OUT_OF_RANGE extends RangeError { } msg += ` It must be ${range}. Received ${received}`; - super(msg); - - const { name } = this; - // Add the error code to the name to include it in the stack trace. - this.name = `${name} [${this.code}]`; - // Access the stack to generate the error message including the error code from the name. - this.stack; - // Reset the name to the actual name. - this.name = name; + super("ERR_OUT_OF_RANGE", msg); } } -- cgit v1.2.3