UNPKG

494 BJavaScriptView Raw
1function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
2 if (receiver !== classConstructor) {
3 throw new TypeError("Private static access of wrong provenance");
4 }
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
13 descriptor.value = value;
14 }
15
16 return value;
17}
18
19module.exports = _classStaticPrivateFieldSpecSet;
\No newline at end of file