Skip to content

Commit

Permalink
Use object instead of Map, which is not supported in IE9/10 (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Apr 18, 2020
1 parent 812e2b6 commit 6e35b9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Expand Up @@ -41,7 +41,7 @@ export default class VueI18n {
_root: any
_sync: boolean
_fallbackRoot: boolean
_localeChainCache: Map<string, Array<Locale>>
_localeChainCache: { [key: string]: Array<Locale>; }
_missing: ?MissingHandler
_exist: Function
_silentTranslationWarn: boolean | RegExp
Expand Down Expand Up @@ -237,7 +237,7 @@ export default class VueI18n {

get fallbackLocale (): Locale { return this._vm.fallbackLocale }
set fallbackLocale (locale: Locale): void {
this._localeChainCache = new Map()
this._localeChainCache = {}
this._vm.$set(this._vm, 'fallbackLocale', locale)
}

Expand Down Expand Up @@ -500,10 +500,10 @@ export default class VueI18n {
if (start === '') { return [] }

if (!this._localeChainCache) {
this._localeChainCache = new Map()
this._localeChainCache = {}
}

let chain = this._localeChainCache.get(start)
let chain = this._localeChainCache[start]
if (!chain) {
if (!fallbackLocale) {
fallbackLocale = this.fallbackLocale
Expand Down Expand Up @@ -549,7 +549,7 @@ export default class VueI18n {
null
)
}
this._localeChainCache.set(start, chain)
this._localeChainCache[start] = chain
}
return chain
}
Expand Down

0 comments on commit 6e35b9f

Please sign in to comment.