stream: replace Function.prototype with primordial

PR-URL: https://github.com/nodejs/node/pull/31204
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
This commit is contained in:
Sebastien Ahkrin 2020-01-06 03:32:21 +01:00 committed by Rich Trott
parent bd6d6512f0
commit 607be0c78a
1 changed files with 2 additions and 1 deletions

View File

@ -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))