| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 897934a commit 74582aa
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -350,8 +350,12 @@ CryptoStream.prototype.setKeepAlive = function(enable, initialDelay) { | |||
| 350 | 350 | if (this.socket) this.socket.setKeepAlive(enable, initialDelay); | |
| 351 | 351 | }; | |
| 352 | 352 | ||
| 353 | - CryptoStream.prototype.__defineGetter__('bytesWritten', function() { | ||
| 354 | - return this.socket ? this.socket.bytesWritten : 0; | ||
| 353 | + Object.defineProperty(CryptoStream.prototype, 'bytesWritten', { | ||
| 354 | + configurable: true, | ||
| 355 | + enumerable: true, | ||
| 356 | + get: function() { | ||
| 357 | + return this.socket ? this.socket.bytesWritten : 0; | ||
| 358 | + } | ||
| 355 | 359 | }); | |
| 356 | 360 | ||
| 357 | 361 | CryptoStream.prototype.getPeerCertificate = function(detailed) { | |
@@ -526,27 +530,44 @@ CleartextStream.prototype.address = function() { | |||
| 526 | 530 | return this.socket && this.socket.address(); | |
| 527 | 531 | }; | |
| 528 | 532 | ||
| 529 | - | ||
| 530 | - CleartextStream.prototype.__defineGetter__('remoteAddress', function() { | ||
| 531 | - return this.socket && this.socket.remoteAddress; | ||
| 533 | + Object.defineProperty(CleartextStream.prototype, 'remoteAddress', { | ||
| 534 | + configurable: true, | ||
| 535 | + enumerable: true, | ||
| 536 | + get: function() { | ||
| 537 | + return this.socket && this.socket.remoteAddress; | ||
| 538 | + } | ||
| 532 | 539 | }); | |
| 533 | 540 | ||
| 534 | - CleartextStream.prototype.__defineGetter__('remoteFamily', function() { | ||
| 535 | - return this.socket && this.socket.remoteFamily; | ||
| 541 | + Object.defineProperty(CleartextStream.prototype, 'remoteFamily', { | ||
| 542 | + configurable: true, | ||
| 543 | + enumerable: true, | ||
| 544 | + get: function() { | ||
| 545 | + return this.socket && this.socket.remoteFamily; | ||
| 546 | + } | ||
| 536 | 547 | }); | |
| 537 | 548 | ||
| 538 | - CleartextStream.prototype.__defineGetter__('remotePort', function() { | ||
| 539 | - return this.socket && this.socket.remotePort; | ||
| 549 | + Object.defineProperty(CleartextStream.prototype, 'remotePort', { | ||
| 550 | + configurable: true, | ||
| 551 | + enumerable: true, | ||
| 552 | + get: function() { | ||
| 553 | + return this.socket && this.socket.remotePort; | ||
| 554 | + } | ||
| 540 | 555 | }); | |
| 541 | 556 | ||
| 542 | - | ||
| 543 | - CleartextStream.prototype.__defineGetter__('localAddress', function() { | ||
| 544 | - return this.socket && this.socket.localAddress; | ||
| 557 | + Object.defineProperty(CleartextStream.prototype, 'localAddress', { | ||
| 558 | + configurable: true, | ||
| 559 | + enumerable: true, | ||
| 560 | + get: function() { | ||
| 561 | + return this.socket && this.socket.localAddress; | ||
| 562 | + } | ||
| 545 | 563 | }); | |
| 546 | 564 | ||
| 547 | - | ||
| 548 | - CleartextStream.prototype.__defineGetter__('localPort', function() { | ||
| 549 | - return this.socket && this.socket.localPort; | ||
| 565 | + Object.defineProperty(CleartextStream.prototype, 'localPort', { | ||
| 566 | + configurable: true, | ||
| 567 | + enumerable: true, | ||
| 568 | + get: function() { | ||
| 569 | + return this.socket && this.socket.localPort; | ||
| 570 | + } | ||
| 550 | 571 | }); | |
| 551 | 572 | ||
| 552 | 573 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -662,13 +662,20 @@ function filterDuplicates(names) { | |||
| 662 | 662 | } | |
| 663 | 663 | ||
| 664 | 664 | // Legacy API | |
| 665 | - exports.__defineGetter__('createCredentials', | ||
| 666 | - internalUtil.deprecate(function() { | ||
| 665 | + Object.defineProperty(exports, 'createCredentials', { | ||
| 666 | + configurable: true, | ||
| 667 | + enumerable: true, | ||
| 668 | + get: internalUtil.deprecate(function() { | ||
| 667 | 669 | return require('tls').createSecureContext; | |
| 668 | 670 | }, 'crypto.createCredentials is deprecated. ' + | |
| 669 | - 'Use tls.createSecureContext instead.')); | ||
| 671 | + 'Use tls.createSecureContext instead.') | ||
| 672 | + }); | ||
| 670 | 673 | ||
| 671 | - exports.__defineGetter__('Credentials', internalUtil.deprecate(function() { | ||
| 672 | - return require('tls').SecureContext; | ||
| 673 | - }, 'crypto.Credentials is deprecated. ' + | ||
| 674 | - 'Use tls.SecureContext instead.')); | ||
| 674 | + Object.defineProperty(exports, 'Credentials', { | ||
| 675 | + configurable: true, | ||
| 676 | + enumerable: true, | ||
| 677 | + get: internalUtil.deprecate(function() { | ||
| 678 | + return require('tls').SecureContext; | ||
| 679 | + }, 'crypto.Credentials is deprecated. ' + | ||
| 680 | + 'Use tls.SecureContext instead.') | ||
| 681 | + }); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -251,8 +251,12 @@ | |||
| 251 | 251 | } | |
| 252 | 252 | ||
| 253 | 253 | function setupGlobalConsole() { | |
| 254 | - global.__defineGetter__('console', function() { | ||
| 255 | - return NativeModule.require('console'); | ||
| 254 | + Object.defineProperty(global, 'console', { | ||
| 255 | + configurable: true, | ||
| 256 | + enumerable: true, | ||
| 257 | + get: function() { | ||
| 258 | + return NativeModule.require('console'); | ||
| 259 | + } | ||
| 256 | 260 | }); | |
| 257 | 261 | } | |
| 258 | 262 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -165,11 +165,15 @@ function Interface(input, output, completer, terminal) { | |||
| 165 | 165 | ||
| 166 | 166 | inherits(Interface, EventEmitter); | |
| 167 | 167 | ||
| 168 | - Interface.prototype.__defineGetter__('columns', function() { | ||
| 169 | - var columns = Infinity; | ||
| 170 | - if (this.output && this.output.columns) | ||
| 171 | - columns = this.output.columns; | ||
| 172 | - return columns; | ||
| 168 | + Object.defineProperty(Interface.prototype, 'columns', { | ||
| 169 | + configurable: true, | ||
| 170 | + enumerable: true, | ||
| 171 | + get: function() { | ||
| 172 | + var columns = Infinity; | ||
| 173 | + if (this.output && this.output.columns) | ||
| 174 | + columns = this.output.columns; | ||
| 175 | + return columns; | ||
| 176 | + } | ||
| 173 | 177 | }); | |
| 174 | 178 | ||
| 175 | 179 | Interface.prototype.setPrompt = function(prompt) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments