@vpmedia/phaser 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -156,17 +156,14 @@ export default class {
156
156
  if (soundData) {
157
157
  if (this.game.cache.isSoundDecoded(key) === false) {
158
158
  this.game.cache.updateSound(key, 'isDecoding', true);
159
- const scope = this;
160
- try {
161
- this.context.decodeAudioData(soundData, (buffer) => {
162
- if (buffer) {
163
- scope.game.cache.decodedSound(key, buffer);
164
- scope.onSoundDecode.dispatch(key, sound);
165
- }
159
+ this.context.decodeAudioData(soundData)
160
+ .then((buffer) => {
161
+ this.game.cache.decodedSound(key, buffer);
162
+ this.onSoundDecode.dispatch(key, sound);
163
+ })
164
+ .catch((e) => {
165
+ this.game.exceptionHandler(e);
166
166
  });
167
- } catch (e) {
168
- scope.game.exceptionHandler(e);
169
- }
170
167
  }
171
168
  }
172
169
  }