Skip to content

Commit e01433d

Browse files
Sebastien-AhkrinBethGriggs
authored andcommitted
lib: replace Symbol.hasInstance by SymbolHasInstance
PR-URL: #30948 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 497a1c8 commit e01433d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎lib/_stream_writable.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const{
3030
ObjectDefineProperty,
3131
ObjectSetPrototypeOf,
3232
Symbol,
33+
SymbolHasInstance,
3334
}=primordials;
3435

3536
module.exports=Writable;
@@ -196,9 +197,9 @@ ObjectDefineProperty(WritableState.prototype, 'buffer',{
196197
// Test _writableState for inheritance to account for Duplex streams,
197198
// whose prototype chain only points to Readable.
198199
varrealHasInstance;
199-
if(typeofSymbol==='function'&&Symbol.hasInstance){
200-
realHasInstance=Function.prototype[Symbol.hasInstance];
201-
ObjectDefineProperty(Writable,Symbol.hasInstance,{
200+
if(typeofSymbol==='function'&&SymbolHasInstance){
201+
realHasInstance=Function.prototype[SymbolHasInstance];
202+
ObjectDefineProperty(Writable,SymbolHasInstance,{
202203
value: function(object){
203204
if(realHasInstance.call(this,object))
204205
returntrue;

‎lib/internal/console/constructor.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const{
1414
ObjectValues,
1515
ReflectOwnKeys,
1616
Symbol,
17+
SymbolHasInstance,
1718
}=primordials;
1819

1920
const{ trace }=internalBinding('trace_events');
@@ -128,7 +129,7 @@ const consolePropAttributes ={
128129
};
129130

130131
// Fixup global.console instanceof global.console.Console
131-
ObjectDefineProperty(Console,Symbol.hasInstance,{
132+
ObjectDefineProperty(Console,SymbolHasInstance,{
132133
value(instance){
133134
returninstance[kIsConsole];
134135
}

0 commit comments

Comments
(0)