-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console: bind methods from the prototype chain in Console #24047
Closed
Conversation
This file contains 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
In 62232361 we made the console.Console function construct an object with methods from Console.prototype bound to the instance, instead of with methods found on the prototype chain to be bound on the instances, thus breaking users overriding these methods when subclassing Console because they are not expecting this function to construct a namespace whose methods are not looked up from the prototype chain. This patch restores the previous behavior since it does not affect the characteristics of the global console anyway. So after this patch, the Console function still constructs normal objects with function properties looked up from the prototype chain but bound to the instances always.
nodejs-github-bot
added
the
console
Issues and PRs related to the console subsystem.
label
Nov 2, 2018
jdalton
approved these changes
Nov 2, 2018
lpinca
approved these changes
Nov 2, 2018
cjihrig
approved these changes
Nov 4, 2018
joyeecheung
added
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
Nov 6, 2018
Landed in 04a291a |
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
Nov 6, 2018
In 62232361 we made the console.Console function construct an object with methods from Console.prototype bound to the instance, instead of with methods found on the prototype chain to be bound on the instances, thus breaking users overriding these methods when subclassing Console because they are not expecting this function to construct a namespace whose methods are not looked up from the prototype chain. This patch restores the previous behavior since it does not affect the characteristics of the global console anyway. So after this patch, the Console function still constructs normal objects with function properties looked up from the prototype chain but bound to the instances always. PR-URL: nodejs#24047 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
3 tasks
joyeecheung
added a commit
to joyeecheung/node
that referenced
this pull request
Jan 9, 2019
In 62232361 we made the console.Console function construct an object with methods from Console.prototype bound to the instance, instead of with methods found on the prototype chain to be bound on the instances, thus breaking users overriding these methods when subclassing Console because they are not expecting this function to construct a namespace whose methods are not looked up from the prototype chain. This patch restores the previous behavior since it does not affect the characteristics of the global console anyway. So after this patch, the Console function still constructs normal objects with function properties looked up from the prototype chain but bound to the instances always. PR-URL: nodejs#24047 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
2 tasks
BridgeAR
pushed a commit
that referenced
this pull request
Jan 9, 2019
In 62232361 we made the console.Console function construct an object with methods from Console.prototype bound to the instance, instead of with methods found on the prototype chain to be bound on the instances, thus breaking users overriding these methods when subclassing Console because they are not expecting this function to construct a namespace whose methods are not looked up from the prototype chain. This patch restores the previous behavior since it does not affect the characteristics of the global console anyway. So after this patch, the Console function still constructs normal objects with function properties looked up from the prototype chain but bound to the instances always. PR-URL: #24047 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Merged
BridgeAR
pushed a commit
to BridgeAR/node
that referenced
this pull request
Jan 16, 2019
In 62232361 we made the console.Console function construct an object with methods from Console.prototype bound to the instance, instead of with methods found on the prototype chain to be bound on the instances, thus breaking users overriding these methods when subclassing Console because they are not expecting this function to construct a namespace whose methods are not looked up from the prototype chain. This patch restores the previous behavior since it does not affect the characteristics of the global console anyway. So after this patch, the Console function still constructs normal objects with function properties looked up from the prototype chain but bound to the instances always. PR-URL: nodejs#24047 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Merged
@BridgeAR, should this be backported to v10.x? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
console
Issues and PRs related to the console subsystem.
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.
In 62232361 we made the console.Console function construct an object
with methods from Console.prototype bound to the instance, instead of
with methods found on the prototype chain to be bound on the instances,
thus breaking users overriding these methods when subclassing Console
because they are not expecting this function to construct a
namespace whose methods are not looked up from the prototype
chain.
This patch restores the previous behavior since it does not affect
the characteristics of the global console anyway. So after this patch,
the Console function still constructs normal objects with function
properties looked up from the prototype chain but bound to the
instances always.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes