diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index c65db3cbee8880..e6195c60516354 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -30,6 +30,7 @@ const { ObjectDefineProperty, ObjectSetPrototypeOf, Symbol, + SymbolHasInstance, } = primordials; module.exports = Writable; @@ -196,9 +197,9 @@ ObjectDefineProperty(WritableState.prototype, 'buffer', { // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance) { - realHasInstance = Function.prototype[Symbol.hasInstance]; - ObjectDefineProperty(Writable, Symbol.hasInstance, { +if (typeof Symbol === 'function' && SymbolHasInstance) { + realHasInstance = Function.prototype[SymbolHasInstance]; + ObjectDefineProperty(Writable, SymbolHasInstance, { value: function(object) { if (realHasInstance.call(this, object)) return true; diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 054e1bb2631a81..aab46fb6d40af8 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -14,6 +14,7 @@ const { ObjectValues, ReflectOwnKeys, Symbol, + SymbolHasInstance, } = primordials; const { trace } = internalBinding('trace_events'); @@ -128,7 +129,7 @@ const consolePropAttributes = { }; // Fixup global.console instanceof global.console.Console -ObjectDefineProperty(Console, Symbol.hasInstance, { +ObjectDefineProperty(Console, SymbolHasInstance, { value(instance) { return instance[kIsConsole]; }