Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 581e837

Browse filesBrowse files
Sebastien-Ahkrintargos
authored andcommitted
lib: replace Symbol.hasInstance by SymbolHasInstance
PR-URL: #30948 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5cfcf6f commit 581e837
Copy full SHA for 581e837

File tree

Expand file treeCollapse file tree

2 files changed

+6
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-4
lines changed
Open diff view settings
Collapse file

‎lib/_stream_writable.js‎

Copy file name to clipboardExpand all lines: lib/_stream_writable.js
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const {
3030
ObjectDefineProperty,
3131
ObjectSetPrototypeOf,
3232
Symbol,
33+
SymbolHasInstance,
3334
} = primordials;
3435

3536
module.exports = Writable;
@@ -196,9 +197,9 @@ ObjectDefineProperty(WritableState.prototype, 'buffer', {
196197
// Test _writableState for inheritance to account for Duplex streams,
197198
// whose prototype chain only points to Readable.
198199
var realHasInstance;
199-
if (typeof Symbol === 'function' && Symbol.hasInstance) {
200-
realHasInstance = Function.prototype[Symbol.hasInstance];
201-
ObjectDefineProperty(Writable, Symbol.hasInstance, {
200+
if (typeof Symbol === 'function' && SymbolHasInstance) {
201+
realHasInstance = Function.prototype[SymbolHasInstance];
202+
ObjectDefineProperty(Writable, SymbolHasInstance, {
202203
value: function(object) {
203204
if (realHasInstance.call(this, object))
204205
return true;
Collapse file

‎lib/internal/console/constructor.js‎

Copy file name to clipboardExpand all lines: lib/internal/console/constructor.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const {
1414
ObjectValues,
1515
ReflectOwnKeys,
1616
Symbol,
17+
SymbolHasInstance,
1718
} = primordials;
1819

1920
const { trace } = internalBinding('trace_events');
@@ -128,7 +129,7 @@ const consolePropAttributes = {
128129
};
129130

130131
// Fixup global.console instanceof global.console.Console
131-
ObjectDefineProperty(Console, Symbol.hasInstance, {
132+
ObjectDefineProperty(Console, SymbolHasInstance, {
132133
value(instance) {
133134
return instance[kIsConsole];
134135
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.