Object.keys does not return all methods of a class.
Fixes: https://tracker.ceph.com/issues/41368
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
}
function encodeClass(target: Function) {
- for (const propertyName of Object.keys(target.prototype)) {
+ for (const propertyName of Object.getOwnPropertyNames(target.prototype)) {
const descriptor = Object.getOwnPropertyDescriptor(target.prototype, propertyName);
const isMethod = descriptor.value instanceof Function;
- if (!isMethod) {
+ const isConstructor = propertyName === 'constructor';
+ if (!isMethod || isConstructor) {
continue;
}