mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 22:12:48 -05:00
check for own property in for (var _ in _ )
This commit is contained in:
parent
1c4709e5b9
commit
de99228cd8
1 changed files with 5 additions and 3 deletions
|
@ -178,7 +178,7 @@ function AudioPlayer (audioEngine) {
|
|||
this.clearEffects();
|
||||
|
||||
// sound players that are currently playing, indexed by the sound's md5
|
||||
this.activeSoundPlayers = Object.create(null);
|
||||
this.activeSoundPlayers = {};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,8 +209,10 @@ AudioPlayer.prototype.playSound = function (md5) {
|
|||
|
||||
// remove sounds that are not playing from the active sound players array
|
||||
for (var id in this.activeSoundPlayers) {
|
||||
if (!this.activeSoundPlayers[id].isPlaying) {
|
||||
delete this.activeSoundPlayers[id];
|
||||
if (this.activeSoundPlayers.hasOwnProperty(id)) {
|
||||
if (!this.activeSoundPlayers[id].isPlaying) {
|
||||
delete this.activeSoundPlayers[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue