Commit 04a291ab authored by Joyee Cheung's avatar Joyee Cheung Committed by Rich Trott
Browse files

console: bind methods from the prototype chain in Console

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: https://github.com/nodejs/node/pull/24047


Reviewed-By: default avatarJohn-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent c3b674cc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment