Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Bug 1108099 - Make formatValue wait for Context.isReady. r=gandalf
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Dec 6, 2014
1 parent 90c20bc commit faee3c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/l20n/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function Context(id) {
this.locales = {};

this._emitter = new EventEmitter();
this._ready = new Promise(this.once.bind(this));
}


Expand Down Expand Up @@ -92,7 +93,7 @@ function formatEntity(args, entity) {
}

function formatAsync(fn, id, args) {
return Promise.resolve().then(
return this._ready.then(
getWithFallback.bind(this, id)).then(
fn.bind(this, args),
reportMissing.bind(this, id));
Expand Down

0 comments on commit faee3c8

Please sign in to comment.