@vpmedia/phaser 1.0.3 → 1.0.4

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.3",
3
+ "version": "1.0.4",
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",
@@ -18,22 +18,22 @@
18
18
  "main": "./src/index.js",
19
19
  "devDependencies": {
20
20
  "@babel/cli": "^7.19.3",
21
- "@babel/core": "^7.19.6",
21
+ "@babel/core": "^7.20.2",
22
22
  "@babel/eslint-parser": "^7.19.1",
23
- "@babel/preset-env": "^7.19.4",
23
+ "@babel/preset-env": "^7.20.2",
24
24
  "@babel/register": "^7.18.9",
25
25
  "babel-loader": "^8.3.0",
26
- "eslint": "^8.26.0",
26
+ "eslint": "^8.28.0",
27
27
  "eslint-config-prettier": "^8.5.0",
28
28
  "eslint-plugin-import": "^2.26.0",
29
- "eslint-plugin-jest": "^27.1.3",
29
+ "eslint-plugin-jest": "^27.1.5",
30
30
  "eslint-plugin-jsdoc": "^39.6.2",
31
31
  "eslint-plugin-prettier": "^4.2.1",
32
- "husky": "^8.0.1",
33
- "jest": "^29.2.2",
32
+ "husky": "^8.0.2",
33
+ "jest": "^29.3.1",
34
34
  "lint-staged": "^13.0.3",
35
35
  "prettier": "^2.7.1",
36
- "webpack": "^5.74.0",
36
+ "webpack": "^5.75.0",
37
37
  "webpack-cli": "^4.10.0"
38
38
  },
39
39
  "scripts": {
@@ -220,7 +220,7 @@ export function checkBrowser(device) {
220
220
  if (device.cocoonJS) {
221
221
  try {
222
222
  device.cocoonJSApp = (typeof CocoonJS !== 'undefined');
223
- } catch (error) {
223
+ } catch (e) {
224
224
  device.cocoonJSApp = false;
225
225
  }
226
226
  }
@@ -143,6 +143,7 @@ export default class {
143
143
  isWebGlReady = true;
144
144
  } catch (e) {
145
145
  isWebGlReady = false;
146
+ this.exceptionHandler(e);
146
147
  }
147
148
  /*
148
149
  this.renderer = new WebGLRenderer(this);
@@ -216,6 +217,13 @@ export default class {
216
217
  if (config.renderer) {
217
218
  this.config.renderType = config.renderer;
218
219
  }
220
+ if (config.exceptionHandler) {
221
+ this.exceptionHandler = config.exceptionHandler;
222
+ } else {
223
+ this.exceptionHandler = (e) => {
224
+ console.error(e);
225
+ };
226
+ }
219
227
  if (config.parent) {
220
228
  this.parent = config.parent;
221
229
  }
@@ -769,7 +769,7 @@ export default class {
769
769
  if (!scope.hasLoaded) {
770
770
  scope.asyncComplete(file, e.message || 'Exception');
771
771
  } else {
772
- console.error(e);
772
+ scope.game.exceptionHandler(e);
773
773
  }
774
774
  }
775
775
  return null;
@@ -781,7 +781,7 @@ export default class {
781
781
  if (!scope.hasLoaded) {
782
782
  scope.asyncComplete(file, e.message || 'Exception');
783
783
  } else {
784
- console.error(e);
784
+ scope.game.exceptionHandler(e);
785
785
  }
786
786
  }
787
787
  return null;
@@ -40,7 +40,7 @@ export default class {
40
40
  } else if (window.AudioContext) {
41
41
  try {
42
42
  this.context = new window.AudioContext();
43
- } catch (error) {
43
+ } catch (e) {
44
44
  this.context = null;
45
45
  this.usingWebAudio = false;
46
46
  this.touchLocked = false;
@@ -48,7 +48,7 @@ export default class {
48
48
  } else if (window.webkitAudioContext) {
49
49
  try {
50
50
  this.context = new window.webkitAudioContext();
51
- } catch (error) {
51
+ } catch (e) {
52
52
  this.context = null;
53
53
  this.usingWebAudio = false;
54
54
  this.touchLocked = false;