diff --git a/packages/pg-pool/index.js b/packages/pg-pool/index.js index 79a3eca32..dd0d478d2 100644 --- a/packages/pg-pool/index.js +++ b/packages/pg-pool/index.js @@ -67,8 +67,8 @@ class Pool extends EventEmitter { Object.defineProperty(this.options, 'password', { configurable: true, enumerable: false, - value: options.password, - writable: true + writable: true, + value: options.password }) } diff --git a/packages/pg/lib/client.js b/packages/pg/lib/client.js index fe1ce8baf..c929d26f3 100644 --- a/packages/pg/lib/client.js +++ b/packages/pg/lib/client.js @@ -33,12 +33,11 @@ var Client = function (config) { // "hiding" the password so it doesn't show up in stack traces // or if the client is console.logged - const password = this.connectionParameters.password Object.defineProperty(this, 'password', { + configurable: true, enumerable: false, - configurable: false, writable: true, - value: password + value: this.connectionParameters.password }) this.replication = this.connectionParameters.replication diff --git a/packages/pg/lib/connection-parameters.js b/packages/pg/lib/connection-parameters.js index 55569e070..c0f8498eb 100644 --- a/packages/pg/lib/connection-parameters.js +++ b/packages/pg/lib/connection-parameters.js @@ -57,12 +57,11 @@ var ConnectionParameters = function (config) { // "hiding" the password so it doesn't show up in stack traces // or if the client is console.logged - const password = val('password', config) Object.defineProperty(this, 'password', { + configurable: true, enumerable: false, - configurable: false, writable: true, - value: password + value: val('password', config) }) this.binary = val('binary', config)