Improved the definition of structures' client properties

This commit is contained in:
Schuyler Cebulskie
2016-12-02 19:52:27 -05:00
parent edfb27f428
commit 2488e1a00f
15 changed files with 46 additions and 31 deletions

View File

@@ -9,15 +9,16 @@ class Webhook {
if (client) {
/**
* The Client that instantiated the Webhook
* @name Webhook#client
* @type {Client}
* @readonly
*/
this.client = client;
Object.defineProperty(this, 'client', { enumerable: false, configurable: false });
Object.defineProperty(this, 'client', { value: client });
if (dataOrID) this.setup(dataOrID);
} else {
this.id = dataOrID;
this.token = token;
this.client = this;
Object.defineProperty(this, 'client', { value: this });
}
}