try {
sr.evaluate("var x /");
assertEq(true, false, "Should have thrown");
} catch (e) {
assertEq(e instanceof SyntaxError, true, "Same Global Error")
assertEq(/unterminated regular expression literal/.test(e.message), true, "Should have reported a sensible error message");
}
try {
sr.evaluate("var x =");
assertEq(true, false, "Should have thrown");
} catch (e) {
assertEq(e instanceof SyntaxError, true, "Same Global Error")
assertEq(/expected expression/.test(e.message), true, "Should have reported a sensible error message");
}
try {
sr.evaluate("#x in this");
assertEq(true, false, "Should have thrown");
} catch (e) {
assertEq(e instanceof SyntaxError, true, "Same Global Error")
assertEq(/reference to undeclared private field or method/.test(e.message), true, "Should have reported a sensible error message");
}
if (typeof reportCompare === 'function')
reportCompare(true, true);
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.