Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ module.exports.Component = registerComponent('sound', {
for (i = 0; i < this.pool.children.length; i++) {
sound = this.pool.children[i];
sound.onEnded = function () {
this.isPlaying = false;
self.isPlaying = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question for whomever does review this from the AFrame team.

Are we explicitly avoiding arrow functions to capture this?

If we are, should we instead be using the bind() helper instead of capturing a "self"? This would make things more consistent. We tend to use bind() for simple functions and any complex function wrappers we instead use self.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, no arrow functions: Not supported in IE 11. As @DigiTec said probably bind a bit cleaner than self.

el.emit('sound-ended', self.evtDetail, false);
};
}
Expand Down