Removed comment since border case appeared in Edge.

This commit is contained in:
Uwe Oestermeier 2020-02-25 15:19:01 +01:00
parent 9db5723746
commit 70031d3bfa
3 changed files with 44 additions and 6 deletions

9
dist/iwmlib.js vendored
View File

@ -429,9 +429,12 @@
window.addEventListener(
'error',
event => {
// if (typeof(event.error) == 'undefined') {
// console.info("Catched undefined error", event)
// }
if (typeof(event.error) == 'undefined') {
// This sometimes happens in Edge. Since we have no error
// position, we cannot do much beside an info log.
console.info("Catched undefined error", event);
return
}
this.appendError(event.error, event.filename);
},
true

32
dist/iwmlib.pixi.js vendored
View File

@ -1335,6 +1335,19 @@
static toLine(event) {
return `${event.type} #${event.target.id} ${event.clientX} ${event.clientY}`
let result = event.type;
let selector = this.selector(event.target);
result += ' selector: ' + selector;
if (event.target != document.querySelector(selector)) console.log('Cannot resolve', selector);
let keys = ['layerX', 'layerY', 'pageX', 'pageY', 'clientX', 'clientY'];
for (let key of keys) {
try {
result += ' ' + key + ':' + event[key];
} catch (e) {
console.log('Invalid key: ' + key);
}
}
return result
}
static compareExtractedWithSimulated() {
@ -6174,6 +6187,25 @@
result[id] = this.getPosition(event);
break
}
// case 'TouchEvent':
// // Needs to be observed: Perhaps changedTouches are all we need. If so
// // we can remove the touchEventKey default parameter
// if (touchEventKey == 'all') {
// for(let t of event.targetTouches) {
// result[t.identifier.toString()] = this.getPosition(t)
// }
// for(let t of event.changedTouches) {
// result[t.identifier.toString()] = this.getPosition(t)
// }
// }
// else {
// for(let t of event.changedTouches) {
// result[t.identifier.toString()] = this.getPosition(t)
// }
// }
// break
default:
break
}
return result
}

View File

@ -117,9 +117,12 @@ export default class Errors {
window.addEventListener(
'error',
event => {
// if (typeof(event.error) == 'undefined') {
// console.info("Catched undefined error", event)
// }
if (typeof(event.error) == 'undefined') {
// This sometimes happens in Edge. Since we have no error
// position, we cannot do much beside an info log.
console.info("Catched undefined error", event)
return
}
this.appendError(event.error, event.filename)
},
true