propertyDescriptors.js 356 B

12345678910111213141516
  1. "use strict";
  2. const prepareValue = require("../parsers").prepareValue;
  3. module.exports.getPropertyDescriptor = function getPropertyDescriptor(property) {
  4. return {
  5. set(v) {
  6. this._setProperty(property, prepareValue(v));
  7. },
  8. get() {
  9. return this.getPropertyValue(property);
  10. },
  11. enumerable: true,
  12. configurable: true
  13. };
  14. };