classApplyDescriptorDestructureSet.js 458 B

1234567891011121314151617181920
  1. export default 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. }