classStaticPrivateFieldSpecSet.js 368 B

123456789101112
  1. export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
  2. if (receiver !== classConstructor) {
  3. throw new TypeError("Private static access of wrong provenance");
  4. }
  5. if (!descriptor.writable) {
  6. throw new TypeError("attempted to set read only private field");
  7. }
  8. descriptor.value = value;
  9. return value;
  10. }