angular-cn/packages/common/test/i18n
Artem Halas 6acea54f62 fix(common): mark locale data arrays as readonly (#30397)
To discourage developers from mutating the arrays returned
from the following methods, their return types have been marked
as readonly.

* `getLocaleDayPeriods()`
* `getLocaleDayNames()`
* `getLocaleMonthNames()`
* `getLocaleEraNames()`

Fixes #27003

BREAKING CHANGE:
The locale data API has been marked as returning readonly arrays, rather
than mutable arrays, since these arrays are shared across calls to the
API. If you were mutating them (e.g. calling `sort()`, `push()`, `splice()`, etc)
then your code will not longer compile. If you need to mutate the array, you
should now take a copy (e.g. by calling `slice()`) and mutate the copy.

PR Close #30397
2020-09-10 15:35:30 -07:00
..
format_date_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
format_number_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
locale_data_api_spec.ts fix(common): mark locale data arrays as readonly (#30397) 2020-09-10 15:35:30 -07:00
localization_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00