From 607be0c78a6bd33a105d2a690f6e71264016252c 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 8d427f1afe1da6..3f029883705a0a 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -27,6 +27,7 @@ const { Array, + FunctionPrototype, ObjectDefineProperty, ObjectSetPrototypeOf, Symbol, @@ -205,7 +206,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))