| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5cfcf6f commit 581e837
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,7 @@ const { | |||
| 30 | 30 | ObjectDefineProperty, | |
| 31 | 31 | ObjectSetPrototypeOf, | |
| 32 | 32 | Symbol, | |
| 33 | + SymbolHasInstance, | ||
| 33 | 34 | } = primordials; | |
| 34 | 35 | ||
| 35 | 36 | module.exports = Writable; | |
@@ -196,9 +197,9 @@ ObjectDefineProperty(WritableState.prototype, 'buffer', { | |||
| 196 | 197 | // Test _writableState for inheritance to account for Duplex streams, | |
| 197 | 198 | // whose prototype chain only points to Readable. | |
| 198 | 199 | var realHasInstance; | |
| 199 | - if (typeof Symbol === 'function' && Symbol.hasInstance) { | ||
| 200 | - realHasInstance = Function.prototype[Symbol.hasInstance]; | ||
| 201 | - ObjectDefineProperty(Writable, Symbol.hasInstance, { | ||
| 200 | + if (typeof Symbol === 'function' && SymbolHasInstance) { | ||
| 201 | + realHasInstance = Function.prototype[SymbolHasInstance]; | ||
| 202 | + ObjectDefineProperty(Writable, SymbolHasInstance, { | ||
| 202 | 203 | value: function(object) { | |
| 203 | 204 | if (realHasInstance.call(this, object)) | |
| 204 | 205 | return true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,6 +14,7 @@ const { | |||
| 14 | 14 | ObjectValues, | |
| 15 | 15 | ReflectOwnKeys, | |
| 16 | 16 | Symbol, | |
| 17 | + SymbolHasInstance, | ||
| 17 | 18 | } = primordials; | |
| 18 | 19 | ||
| 19 | 20 | const { trace } = internalBinding('trace_events'); | |
@@ -128,7 +129,7 @@ const consolePropAttributes = { | |||
| 128 | 129 | }; | |
| 129 | 130 | ||
| 130 | 131 | // Fixup global.console instanceof global.console.Console | |
| 131 | - ObjectDefineProperty(Console, Symbol.hasInstance, { | ||
| 132 | + ObjectDefineProperty(Console, SymbolHasInstance, { | ||
| 132 | 133 | value(instance) { | |
| 133 | 134 | return instance[kIsConsole]; | |
| 134 | 135 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments