In an Android 4.4 emulator for example, when zone.js is loaded, executing new Intl.NumberFormat().format(36000) raises the following error: TypeError: Cannot redefine property: length
The reason behind it some V8 code which freezes an array of locales after initialising it:
https://github.com/v8/v8/blob/d93fd41aaa0982ae8c4226cce3f2629649ebe87a/src/js/i18n.js#L577
With the new Object.defineProperty from zone.js, it fails because it actually executes something like:
Object.defineProperty([], 'length', {value: 0, writable: false, configurable: true})
which fails in any version of Chrome.
Apparently, in recent version of Chrome, it seems that the list of locales is initialised only once, before zone.js is loaded. So there is no issue.
But in older version, the initialisation is done each time new Intl.NumberFormat() or Intl.DateFormat() are called, hence the problem.
The issue was reported in angular/angular#8188 and can also be seen when running Angular's Intl unit tests in these browsers.
In an Android 4.4 emulator for example, when zone.js is loaded, executing
new Intl.NumberFormat().format(36000)raises the following error:TypeError: Cannot redefine property: lengthThe reason behind it some V8 code which freezes an array of locales after initialising it:
https://github.com/v8/v8/blob/d93fd41aaa0982ae8c4226cce3f2629649ebe87a/src/js/i18n.js#L577
With the new
Object.definePropertyfrom zone.js, it fails because it actually executes something like:Object.defineProperty([], 'length', {value: 0, writable: false, configurable: true})which fails in any version of Chrome.
Apparently, in recent version of Chrome, it seems that the list of locales is initialised only once, before zone.js is loaded. So there is no issue.
But in older version, the initialisation is done each time
new Intl.NumberFormat()orIntl.DateFormat()are called, hence the problem.The issue was reported in angular/angular#8188 and can also be seen when running Angular's Intl unit tests in these browsers.