Commit 7f5bb9d
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: #24047
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>1 parent b2b0645 commit 7f5bb9dCopy full SHA for 7f5bb9d
File tree
Expand file treeCollapse file tree
2 files changed
+10
-1
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+10
-1
lines changedOpen diff view settings
Collapse file
+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
132 | 132 | |
133 | 133 | |
134 | 134 | |
135 | | - |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
136 | 139 | |
137 | 140 | |
138 | 141 | |
|
Collapse file
test/parallel/test-console-instance.js
Copy file name to clipboardExpand all lines: test/parallel/test-console-instance.js+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
105 | 105 | |
106 | 106 | |
107 | 107 | |
| 108 | + |
| 109 | + |
108 | 110 | |
109 | 111 | |
110 | 112 | |
111 | 113 | |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
112 | 118 | |
113 | 119 | |
114 | 120 | |
|
0 commit comments