From 381f5801f924f204e9b7a693d8f6e78e63a654b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 30 Mar 2023 17:33:28 +0200 Subject: Revert "refactor(ext/node): Use Deno.inspect (#17960)" (#18491) This reverts commit a3529d02329e0d2127ad2a5bb78b4c476ddd6984. This change made debugging Node tests very hard - `AssertionError` is now printed as `[Circular *1]` giving no visibility what failed. We need to align two implementations together and remove this one then. --- ext/console/02_console.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'ext/console') diff --git a/ext/console/02_console.js b/ext/console/02_console.js index e93272de1..5547dd230 100644 --- a/ext/console/02_console.js +++ b/ext/console/02_console.js @@ -204,7 +204,7 @@ function isFullWidthCodePoint(code) { ); } -export function getStringWidth(str) { +function getStringWidth(str) { str = StringPrototypeNormalize(colors.stripColor(str), "NFC"); let width = 0; @@ -1339,16 +1339,6 @@ function inspectObject(value, inspectOptions, proxyDetails) { ) { return String(value[customInspect](inspect, inspectOptions)); } - if ( - ReflectHas(value, nodeCustomInspect) && - typeof value[nodeCustomInspect] === "function" - ) { - // TODO(kt3k): The last inspect needs to be util.inspect of Node.js. - // We need to move the implementation of util.inspect to this file. - return String( - value[nodeCustomInspect](inspectOptions.depth, inspectOptions, inspect), - ); - } // This non-unique symbol is used to support op_crates, ie. // in extensions/web we don't want to depend on public // Symbol.for("Deno.customInspect") symbol defined in the public API. @@ -2325,7 +2315,6 @@ class Console { } const customInspect = SymbolFor("Deno.customInspect"); -const nodeCustomInspect = SymbolFor("nodejs.util.inspect.custom"); function inspect( value, -- cgit v1.2.3