diff options
Diffstat (limited to 'js/console.ts')
-rw-r--r-- | js/console.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/js/console.ts b/js/console.ts index e08fc445e..c4c36e7b2 100644 --- a/js/console.ts +++ b/js/console.ts @@ -23,11 +23,13 @@ function stringify(ctx: ConsoleContext, value: any): string { case "symbol": return String(value); case "function": + // Might be Function/AsyncFunction/GeneratorFunction + const cstrName = value.__proto__.constructor.name; if (value.name && value.name !== "anonymous") { // from MDN spec - return `[Function: ${value.name}]`; + return `[${cstrName}: ${value.name}]`; } - return "[Function]"; + return `[${cstrName}]`; case "object": if (value === null) { return "null"; |