From a987972bde483d2a88476eabbcd46cf92c28707d Mon Sep 17 00:00:00 2001 From: Sebastien Ahkrin Date: Mon, 6 Jan 2020 03:32:21 +0100 Subject: [PATCH] stream: replace Function.prototype with primordial PR-URL: https://github.com/nodejs/node/pull/31204 Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Jiawen Geng --- lib/_stream_writable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 381f7336765111..067aa86442383a 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -27,6 +27,7 @@ const { Array, + FunctionPrototype, ObjectDefineProperty, ObjectSetPrototypeOf, Symbol, @@ -199,7 +200,7 @@ ObjectDefineProperty(WritableState.prototype, 'buffer', { // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && SymbolHasInstance) { - realHasInstance = Function.prototype[SymbolHasInstance]; + realHasInstance = FunctionPrototype[SymbolHasInstance]; ObjectDefineProperty(Writable, SymbolHasInstance, { value: function(object) { if (realHasInstance.call(this, object))