diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-22 02:17:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 02:17:14 +0100 |
commit | 1ec357faf37916ba84ad7a57208e48103294885a (patch) | |
tree | da235cfc13738ce6eaae5a747119615e5b2a2cf9 /ext | |
parent | 5c7dc904fb78cbf2d9e4707a9172a9291a55f8ab (diff) |
fix(inspector): ensure console methods provided by inspector are available (#16724)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/console/02_console.js | 9 | ||||
-rw-r--r-- | ext/console/lib.deno_console.d.ts | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js index 7554a88fc..9a9ead5a1 100644 --- a/ext/console/02_console.js +++ b/ext/console/02_console.js @@ -2239,6 +2239,12 @@ this.error(err.stack); }; + // These methods are noops, but when the inspector is connected, they + // call into V8. + profile = (_label) => {}; + profileEnd = (_label) => {}; + timeStamp = (_label) => {}; + static [SymbolHasInstance](instance) { return instance[isConsoleInstance]; } @@ -2332,6 +2338,9 @@ consoleFromV8[key], consoleFromDeno[key], ); + } else { + // Add additional console APIs from the inspector + consoleFromDeno[key] = consoleFromV8[key]; } } } diff --git a/ext/console/lib.deno_console.d.ts b/ext/console/lib.deno_console.d.ts index ef2dc1cca..b168d1322 100644 --- a/ext/console/lib.deno_console.d.ts +++ b/ext/console/lib.deno_console.d.ts @@ -26,4 +26,13 @@ declare interface Console { timeLog(label?: string, ...data: any[]): void; trace(...data: any[]): void; warn(...data: any[]): void; + + /** This method is a noop, unless used in inspector */ + timeStamp(label?: string): void; + + /** This method is a noop, unless used in inspector */ + profile(label?: string): void; + + /** This method is a noop, unless used in inspector */ + profileEnd(label?: string): void; } |