diff options
Diffstat (limited to 'ext/console')
-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; } |