define-built-in-accessor.js 388 B

12345678
  1. var makeBuiltIn = require('../internals/make-built-in');
  2. var defineProperty = require('../internals/object-define-property');
  3. module.exports = function (target, name, descriptor) {
  4. if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
  5. if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
  6. return defineProperty.f(target, name, descriptor);
  7. };