Bug 1299411 - s/on/once/ in NativeApp's sendMessage r=aswan

This communicates more clearly that we expect only one message/event.

MozReview-Commit-ID: 8jDYBVwqQtz

--HG--
extra : rebase_source : acae1570537b17027901253afc2344ffabd7a9ee
This commit is contained in:
Rob Wu 2016-09-24 13:22:31 +02:00
Родитель edfaa70caa
Коммит 13c2b6a47f
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -430,8 +430,8 @@ this.NativeApp = class extends EventEmitter {
sendMessage(msg) { sendMessage(msg) {
let responsePromise = new Promise((resolve, reject) => { let responsePromise = new Promise((resolve, reject) => {
this.on("message", (what, msg) => { resolve(msg); }); this.once("message", (what, msg) => { resolve(msg); });
this.on("disconnect", (what, err) => { reject(err); }); this.once("disconnect", (what, err) => { reject(err); });
}); });
let result = this.startupPromise.then(() => { let result = this.startupPromise.then(() => {