Skip to content

Commit 53686af

Browse files
lib: replace Symbol.hasInstance by SymbolHasInstance
1 parent 76cbb66 commit 53686af

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/_stream_writable.js

+4-3
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;
@@ -203,9 +204,9 @@ ObjectDefineProperty(WritableState.prototype, 'buffer', {
203204
// Test _writableState for inheritance to account for Duplex streams,
204205
// whose prototype chain only points to Readable.
205206
var realHasInstance;
206-
if (typeof Symbol === 'function' && Symbol.hasInstance) {
207-
realHasInstance = Function.prototype[Symbol.hasInstance];
208-
ObjectDefineProperty(Writable, Symbol.hasInstance, {
207+
if (typeof Symbol === 'function' && SymbolHasInstance) {
208+
realHasInstance = Function.prototype[SymbolHasInstance];
209+
ObjectDefineProperty(Writable, SymbolHasInstance, {
209210
value: function(object) {
210211
if (realHasInstance.call(this, object))
211212
return true;

lib/internal/console/constructor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
ObjectValues,
1717
ReflectOwnKeys,
1818
Symbol,
19+
SymbolHasInstance,
1920
} = primordials;
2021

2122
const { trace } = internalBinding('trace_events');
@@ -134,7 +135,7 @@ const consolePropAttributes = {
134135
};
135136

136137
// Fixup global.console instanceof global.console.Console
137-
ObjectDefineProperty(Console, Symbol.hasInstance, {
138+
ObjectDefineProperty(Console, SymbolHasInstance, {
138139
value(instance) {
139140
return instance[kIsConsole];
140141
}

0 commit comments

Comments
 (0)