mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
loadTranslations stores parsed translations into the shared global $localize.TRANSLATIONS keyed by message id. Those ids come verbatim from the translations map (typically parsed from a translation file), so a translation whose id is __proto__ assigns through the inherited __proto__ setter, reparenting the map rather than storing the entry (and throwing under --disable-proto=throw). Create the map with Object.create(null) in loadTranslations and clearTranslations so __proto__ is an ordinary key.