If I use the following javascript code:
<code>class test {
static 'a-a';
static 'b-b';
static 'c-c';
}
console.log(Object.keys(test))
// output (chrome console): ['a-a', 'b-b', 'c-c']
</code>
<code>class test {
static 'a-a';
static 'b-b';
static 'c-c';
}
console.log(Object.keys(test))
// output (chrome console): ['a-a', 'b-b', 'c-c']
</code>
class test {
static 'a-a';
static 'b-b';
static 'c-c';
}
console.log(Object.keys(test))
// output (chrome console): ['a-a', 'b-b', 'c-c']
I can, at runtime enumerate the static fields.
In typescript, however, this does not work (repro):
<code> class test {
static 'a-a': unknown;
static 'b-b': unknown;
static 'c-c': unknown;
}
console.log(Object.keys(test))
</code>
<code> class test {
static 'a-a': unknown;
static 'b-b': unknown;
static 'c-c': unknown;
}
console.log(Object.keys(test))
</code>
class test {
static 'a-a': unknown;
static 'b-b': unknown;
static 'c-c': unknown;
}
console.log(Object.keys(test))
generates this javascript which misses the static fields.
<code>"use strict";
class test {
}
console.log(Object.keys(test));
// output (chrome console): []
</code>
<code>"use strict";
class test {
}
console.log(Object.keys(test));
// output (chrome console): []
</code>
"use strict";
class test {
}
console.log(Object.keys(test));
// output (chrome console): []
I need the runtime enumeration.
Why is it removed?
What can I do to change that?
I tried all imaginable ts compilerOptions but found nothing that helped..