// Notify the test harness to avoid treating the next exception as a test failure.
SimpleTest.expectUncaughtException();
// Invoke the function async so that the exception doesn't get eaten by
// the Promise machinery.
setTimeout(f, 0);
});
}
function testErrorReporting(f, rgxp) {
return new Promise(function(resolve, reject) {
testErrorReportingHelper.bind(null, f, rgxp, false)().then(
testErrorReportingHelper.bind(null, f, rgxp, true)).then(
resolve);
});
}
function go() { var otherWin = $('emptyFrame').contentWindow; var clickMe = $('clickMe');
testErrorReporting.bind(null, () => { throw Error("Simple Error") }, /Simple Error/)().then(
testErrorReporting.bind(null, () => otherWin.eval('throw Error("Cross Global Error")'), /Cross Global Error/)).then(
testErrorReporting.bind(null, () => clickMe.dispatchEvent(new MouseEvent('click')), /thrwan/)).then(
testErrorReporting.bind(null, () => { clickMe.setAttribute('onclick', ' '); /* Make sure we recompile. */
clickMe.setAttribute('onclick', '?');
clickMe.onclick; }, /SyntaxError/)).then(
SimpleTest.finish.bind(SimpleTest));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.