refactor(compiler): use Object.keys instead of Object.getOwnPropertyNames (#10498)
This commit is contained in:

committed by
Alex Rickabaugh

parent
fd19671c07
commit
cd18de7a21
@ -114,14 +114,14 @@ function _serializeReference(ref: any, references: Map<any, string>): string {
|
||||
function _valueProps(obj: any): string[] {
|
||||
const props: string[] = [];
|
||||
// regular public props
|
||||
Object.getOwnPropertyNames(obj).forEach((prop) => {
|
||||
Object.keys(obj).forEach((prop) => {
|
||||
if (!prop.startsWith('_')) {
|
||||
props.push(prop);
|
||||
}
|
||||
});
|
||||
// getters
|
||||
const proto = Object.getPrototypeOf(obj);
|
||||
Object.getOwnPropertyNames(proto).forEach((protoProp) => {
|
||||
Object.keys(proto).forEach((protoProp) => {
|
||||
var desc = Object.getOwnPropertyDescriptor(proto, protoProp);
|
||||
if (!protoProp.startsWith('_') && desc && 'get' in desc) {
|
||||
props.push(protoProp);
|
||||
|
Reference in New Issue
Block a user