You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
463 B

4 years ago
  1. export default function _classPrivateFieldSet(receiver, privateMap, value) {
  2. var descriptor = privateMap.get(receiver);
  3. if (!descriptor) {
  4. throw new TypeError("attempted to set private field on non-instance");
  5. }
  6. if (descriptor.set) {
  7. descriptor.set.call(receiver, value);
  8. } else {
  9. if (!descriptor.writable) {
  10. throw new TypeError("attempted to set read only private field");
  11. }
  12. descriptor.value = value;
  13. }
  14. return value;
  15. }