mirror of https://github.com/nodejs/node.git
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:
parent
bd6d6512f0
commit
607be0c78a
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue