classApplyDescriptorDestructureSet.js 576 B

1234567891011121314151617181920212223
  1. function _classApplyDescriptorDestructureSet(receiver, descriptor) {
  2. if (descriptor.set) {
  3. if (!("__destrObj" in descriptor)) {
  4. descriptor.__destrObj = {
  5. set value(v) {
  6. descriptor.set.call(receiver, v);
  7. }
  8. };
  9. }
  10. return descriptor.__destrObj;
  11. } else {
  12. if (!descriptor.writable) {
  13. throw new TypeError("attempted to set read only private field");
  14. }
  15. return descriptor;
  16. }
  17. }
  18. module.exports = _classApplyDescriptorDestructureSet;
  19. module.exports["default"] = module.exports, module.exports.__esModule = true;