Use arrow functions

This commit is contained in:
Eric Rosenbaum 2017-06-21 11:23:32 -04:00
parent 43e0408434
commit 90af375b03

View file

@ -75,12 +75,11 @@ class SoundPlayer {
* @return {Promise} a Promise that resolves when the sound finishes playing
*/
finished () {
const storedContext = this;
return new Promise(resolve => {
storedContext.bufferSource.onended = function () {
this.bufferSource.onended = () => {
this.isPlaying = false;
resolve();
}.bind(storedContext);
};
});
}
}