3 ms·
MooTools is simply setting a value to a property that did not exist before the assignment. It isn't using Object.defineProperty() to create the property. You ca
by rezonant 4y ago
MooTools is simply setting a value to a property that did not exist before the assignment. It isn't using Object.defineProperty() to create the property. You cannot call Object.defineProperty() twice for the same property (it throws an error).
If assigning a value to a property that was previously defined as non-enumerable were to make it enumerable, then the very act of defining a property would have no value, except in the case where you are making a read-only property (ie using the "writable: false" option for Object.defineProperty).
- shawnz 4y agoYou can specify the value as part of the options to defineProperty, and also it is legal to call defineProperty twice on the same property but with a different value.