refactor(compiler): use Object.keys instead of Object.getOwnPropertyNames (#10498)

This commit is contained in:
Marc Laval
2016-08-04 19:35:41 +02:00
committed by Alex Rickabaugh
parent fd19671c07
commit cd18de7a21
11 changed files with 19 additions and 23 deletions

View File

@ -87,8 +87,8 @@ export class NgPlural {
_updateView(): void {
this._clearViews();
var key = getPluralCategory(
this._switchValue, Object.getOwnPropertyNames(this._caseViews), this._localization);
var key =
getPluralCategory(this._switchValue, Object.keys(this._caseViews), this._localization);
this._activateView(this._caseViews[key]);
}

View File

@ -68,7 +68,7 @@ export class I18nPluralPipe implements PipeTransform {
throw new InvalidPipeArgumentException(I18nPluralPipe, pluralMap);
}
const key = getPluralCategory(value, Object.getOwnPropertyNames(pluralMap), this._localization);
const key = getPluralCategory(value, Object.keys(pluralMap), this._localization);
return StringWrapper.replaceAll(pluralMap[key], _INTERPOLATION_REGEXP, value.toString());
}