mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
Make _array & _keyArray non-enumerable (#1075)
Because Map has no enumerable properties
This commit is contained in:
committed by
Amish Shah
parent
fde3a976aa
commit
b68283e57a
@@ -9,17 +9,19 @@ class Collection extends Map {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cached array for the `array()` method - will be reset to `null` whenever `set()` or `delete()` are called.
|
* Cached array for the `array()` method - will be reset to `null` whenever `set()` or `delete()` are called.
|
||||||
|
* @name Collection#_array
|
||||||
* @type {?Array}
|
* @type {?Array}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this._array = null;
|
Object.defineProperty(this, '_array', { value: null, writable: true, configurable: true });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cached array for the `keyArray()` method - will be reset to `null` whenever `set()` or `delete()` are called.
|
* Cached array for the `keyArray()` method - will be reset to `null` whenever `set()` or `delete()` are called.
|
||||||
|
* @name Collection#_keyArray
|
||||||
* @type {?Array}
|
* @type {?Array}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this._keyArray = null;
|
Object.defineProperty(this, '_keyArray', { value: null, writable: true, configurable: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
set(key, val) {
|
set(key, val) {
|
||||||
|
|||||||
Reference in New Issue
Block a user