In cases, where the caller is looking for the locale to be used for JS Intl API,
we can now replace it with `undefined` which causes JS Intl API to use the default
locale which since bug 1346674 is resolved to the app locale.
This allows us to remove a lot of calls for the app locale.
The remaining ones are split between `AsBCP47` and `AsLangTag`.
Here, the `AsLangTag` is used, as described in the API docs, for cases where
the language string is used for localization purposes, such as language negotaition
matching to our language resources etc.
`AsBCP47` is used when the returned value is handed over to ICU API.
MozReview-Commit-ID: DzmFEUvMq3N
In cases, where the caller is looking for the locale to be used for JS Intl API,
we can now replace it with `undefined` which causes JS Intl API to use the default
locale which since bug 1346674 is resolved to the app locale.
This allows us to remove a lot of calls for the app locale.
The remaining ones are split between `AsBCP47` and `AsLangTag`.
Here, the `AsLangTag` is used, as described in the API docs, for cases where
the language string is used for localization purposes, such as language negotaition
matching to our language resources etc.
`AsBCP47` is used when the returned value is handed over to ICU API.
MozReview-Commit-ID: DzmFEUvMq3N
There are 3 issues this tackles:
- we were keeping a reference to the notification we added (this.notice),
which kept windows alive.
- we had the CleanupManager keep a reference to our close method, which kept
a reference to us, which kept a reference to the window.
- the fact that we use timeouts to call this.close() in 2 places meant
this.close would get called multiple times, which meant we errored out on
later occasions, because various things had been nulled out. This tidies up
the timeouts when cleanup is called to avoid re-entrancy/errors/leaks.
MozReview-Commit-ID: EYvK7bQEh3X