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

committed by
Alex Rickabaugh

parent
fd19671c07
commit
cd18de7a21
@ -299,7 +299,7 @@ function _humanizePlaceholders(
|
||||
// clang-format off
|
||||
// https://github.com/angular/clang-format/issues/35
|
||||
return _extractMessages(html, implicitTags, implicitAttrs).map(
|
||||
msg => Object.getOwnPropertyNames(msg.placeholders).map((name) => `${name}=${msg.placeholders[name]}`).join(', '));
|
||||
msg => Object.keys(msg.placeholders).map((name) => `${name}=${msg.placeholders[name]}`).join(', '));
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
|
@ -69,4 +69,4 @@ function toXmb(html: string): string {
|
||||
catalog.updateFromTemplate(html, '', DEFAULT_INTERPOLATION_CONFIG);
|
||||
|
||||
return catalog.write(serializer);
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,7 @@ export function main(): void {
|
||||
{[id: string]: string} {
|
||||
const asAst = serializer.load(content, 'url', placeholders);
|
||||
let asText: {[id: string]: string} = {};
|
||||
Object.getOwnPropertyNames(asAst).forEach(
|
||||
id => { asText[id] = serializeAst(asAst[id]).join(''); });
|
||||
Object.keys(asAst).forEach(id => { asText[id] = serializeAst(asAst[id]).join(''); });
|
||||
|
||||
return asText;
|
||||
}
|
||||
@ -178,4 +177,4 @@ export function main(): void {
|
||||
it('should throw when trying to save an xmb file',
|
||||
() => { expect(() => { serializer.write({}); }).toThrow(); });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export function extractSchema(): Map<string, string[]> {
|
||||
extractProperties(
|
||||
SVGTextPositioningElement, svgText, visited, descMap, SVG_PREFIX + 'textPositioning',
|
||||
SVG_PREFIX + 'textContent');
|
||||
var keys = Object.getOwnPropertyNames(window).filter(
|
||||
var keys = Object.keys(window).filter(
|
||||
k => k.endsWith('Element') && (k.startsWith('HTML') || k.startsWith('SVG')));
|
||||
keys.sort();
|
||||
keys.forEach(
|
||||
@ -97,7 +97,7 @@ function extractProperties(
|
||||
const fullName = name + (superName ? '^' + superName : '');
|
||||
let props: string[] = descMap.has(fullName) ? descMap.get(fullName) : [];
|
||||
var prototype = type.prototype;
|
||||
var keys = Object.getOwnPropertyNames(prototype);
|
||||
var keys = Object.keys(prototype);
|
||||
keys.sort();
|
||||
keys.forEach((n) => {
|
||||
if (n.startsWith('on')) {
|
||||
|
Reference in New Issue
Block a user