given these two classes
class Foo{
f1;
get f2(){
return "a";
}
}
class Bar extends Foo {
b1;
get b2(){
return "a";
}
}
let bar = new Bar();
What code will get me this list of properties from the bar
instance? ['f1', 'f2', 'b1', 'b2']
Update
This should be part of @Marc C's answer:
Using a decorator I can easily turn a non enumerable property into an enumerable property:
class Bar extends Foo {
@enumerable()
get b2(){
return "a";
}
}
Here is the decorator source:
function enumerable() {
return function(target, key, descriptor) {
if (descriptor) {
descriptor.enumerable = true;
}
};
}