From 0eb5be9a1204f959d3daac8cd7b1b342320970fd Mon Sep 17 00:00:00 2001 From: Gasman <90539473+MarybethGasman@users.noreply.github.com> Date: Sun, 5 Feb 2023 07:34:36 +0800 Subject: fix(ext/console): log class for class constructor (#17615) Co-authored-by: tannal --- ext/console/02_console.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/console') diff --git a/ext/console/02_console.js b/ext/console/02_console.js index 1720fe7e2..a9ec52488 100644 --- a/ext/console/02_console.js +++ b/ext/console/02_console.js @@ -47,6 +47,7 @@ StringPrototypeToString, StringPrototypeTrim, StringPrototypeIncludes, + StringPrototypeStartsWith, TypeError, NumberParseInt, RegExp, @@ -82,6 +83,7 @@ ArrayPrototypeFilter, ArrayPrototypeFind, FunctionPrototypeBind, + FunctionPrototypeToString, Map, MapPrototype, MapPrototypeHas, @@ -347,6 +349,11 @@ // use generic 'Function' instead. cstrName = "Function"; } + const stringValue = FunctionPrototypeToString(value); + // Might be Class + if (StringPrototypeStartsWith(stringValue, "class")) { + cstrName = "Class"; + } // Our function may have properties, so we want to format those // as if our function was an object -- cgit v1.2.3