diff options
author | Gasman <90539473+MarybethGasman@users.noreply.github.com> | 2023-02-05 07:34:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-05 00:34:36 +0100 |
commit | 0eb5be9a1204f959d3daac8cd7b1b342320970fd (patch) | |
tree | 3d84f243bb238964de727ff1f9a91361676336e0 /ext/console/02_console.js | |
parent | 1e75e5ecc72fd6caf1ee3d2c98ea1662e141f55b (diff) |
fix(ext/console): log class for class constructor (#17615)
Co-authored-by: tannal <tannal.cn@gmail.com>
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r-- | ext/console/02_console.js | 7 |
1 files changed, 7 insertions, 0 deletions
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 |