1 |
3a515b92
|
cagy
|
function _classPrivateFieldDestructureSet(receiver, privateMap) {
|
2 |
|
|
if (!privateMap.has(receiver)) {
|
3 |
|
|
throw new TypeError("attempted to set private field on non-instance");
|
4 |
|
|
}
|
5 |
|
|
|
6 |
|
|
var descriptor = privateMap.get(receiver);
|
7 |
|
|
|
8 |
|
|
if (descriptor.set) {
|
9 |
|
|
if (!("__destrObj" in descriptor)) {
|
10 |
|
|
descriptor.__destrObj = {
|
11 |
|
|
set value(v) {
|
12 |
|
|
descriptor.set.call(receiver, v);
|
13 |
|
|
}
|
14 |
|
|
|
15 |
|
|
};
|
16 |
|
|
}
|
17 |
|
|
|
18 |
|
|
return descriptor.__destrObj;
|
19 |
|
|
} else {
|
20 |
|
|
if (!descriptor.writable) {
|
21 |
|
|
throw new TypeError("attempted to set read only private field");
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
return descriptor;
|
25 |
|
|
}
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
module.exports = _classPrivateFieldDestructureSet;
|