2023-04-04 06:05:47 +03:00
|
|
|
export function _class_apply_descriptor_destructure(receiver, descriptor) {
|
2023-03-31 09:15:21 +03:00
|
|
|
if (descriptor.set) {
|
|
|
|
if (!("__destrObj" in descriptor)) {
|
|
|
|
descriptor.__destrObj = {
|
|
|
|
set value(v) {
|
|
|
|
descriptor.set.call(receiver, v);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2023-04-04 06:05:47 +03:00
|
|
|
|
2023-03-31 09:15:21 +03:00
|
|
|
return descriptor.__destrObj;
|
|
|
|
} else {
|
|
|
|
if (!descriptor.writable) {
|
|
|
|
// This should only throw in strict mode, but class bodies are
|
|
|
|
// always strict and private fields can only be used inside
|
|
|
|
// class bodies.
|
|
|
|
throw new TypeError("attempted to set read only private field");
|
|
|
|
}
|
2023-04-04 06:05:47 +03:00
|
|
|
|
2023-03-31 09:15:21 +03:00
|
|
|
return descriptor;
|
2022-02-25 09:08:35 +03:00
|
|
|
}
|
|
|
|
}
|
2023-04-04 06:05:47 +03:00
|
|
|
export { _class_apply_descriptor_destructure as _ };
|