fix(node:console): ensure that the node:console implementation has an implementation for emitWarning in scope#31263
Merged
bartlomieju merged 3 commits intodenoland:mainfrom Nov 13, 2025
Conversation
525e40d to
fb8e7fc
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the node:console implementation's time(), countReset(), and timeLogImpl() functions would fail when calling emitWarning due to it being undefined. The fix imports emitWarning from node:process at the module level, and adds a test to verify these functions work correctly.
- Imports
emitWarningfromnode:processinto the console constructor module - Adds a test that instantiates a Console and calls the previously broken methods
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ext/node/polyfills/internal/console/constructor.mjs | Adds import statement for emitWarning from node:process to make it available in scope |
| tests/unit_node/console_test.ts | Adds test case that calls console methods which trigger emitWarning calls |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d06d01c to
054d0cc
Compare
…n for `emitWarning` in scope Introduces the emitWarning function from the process module to enable warning capabilities within the console constructor implementation. This fixes a bug where the `time`, `countReset` and `timeLogImpl` functions would throw an error due to trying to call `emitWarning`, they would throw an error for an undefined variable named `emitWarning` or if a global function had that name` they would call that function, which is not expected behaviour here.
054d0cc to
d6098d1
Compare
Signed-off-by: Jake Champion <me@jakechampion.name>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bartlomieju
pushed a commit
that referenced
this pull request
Nov 14, 2025
… implementation for `emitWarning` in scope (#31263) Introduces the emitWarning function from the process module to enable warning capabilities within the console constructor implementation. This fixes a bug where the `time`, `countReset` and `timeLogImpl` functions would throw an error due to trying to call `emitWarning`, they would throw an error for an undefined variable named `emitWarning` or if a global function had that name` they would call that function, which is not expected behaviour here. --------- Signed-off-by: Jake Champion <me@jakechampion.name>
bartlomieju
pushed a commit
to bartlomieju/deno
that referenced
this pull request
Nov 17, 2025
… implementation for `emitWarning` in scope (denoland#31263) Introduces the emitWarning function from the process module to enable warning capabilities within the console constructor implementation. This fixes a bug where the `time`, `countReset` and `timeLogImpl` functions would throw an error due to trying to call `emitWarning`, they would throw an error for an undefined variable named `emitWarning` or if a global function had that name` they would call that function, which is not expected behaviour here. --------- Signed-off-by: Jake Champion <me@jakechampion.name>
bartlomieju
pushed a commit
that referenced
this pull request
Jan 22, 2026
… implementation for `emitWarning` in scope (#31263) Introduces the emitWarning function from the process module to enable warning capabilities within the console constructor implementation. This fixes a bug where the `time`, `countReset` and `timeLogImpl` functions would throw an error due to trying to call `emitWarning`, they would throw an error for an undefined variable named `emitWarning` or if a global function had that name` they would call that function, which is not expected behaviour here. --------- Signed-off-by: Jake Champion <me@jakechampion.name>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces the emitWarning function from the process module to enable warning capabilities within the console constructor implementation.
This fixes a bug where the
time,countResetandtimeLogImplfunctions would throw an error due to trying to callemitWarning, they would throw an error for an undefined variable namedemitWarningor if a global function had that name` they would call that function, which is not expected behaviour here.