mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-22 22:34:50 -08:00
30 lines
880 B
HTML
30 lines
880 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>TeaVM JUnit test</title>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript" src="${SCRIPT}"></script>
|
|
<script type="text/javascript">
|
|
main(["${IDENTIFIER}"], function(result) {
|
|
var message = result instanceof Error ? buildErrorMessage(result) : "OK";
|
|
var pre = document.createElement("pre");
|
|
document.body.appendChild(pre);
|
|
pre.appendChild(document.createTextNode(message));
|
|
});
|
|
|
|
function buildErrorMessage(e) {
|
|
var stack = "";
|
|
var je = main.javaException(e);
|
|
if (je && je.constructor.$meta) {
|
|
stack = je.constructor.$meta.name + ": ";
|
|
stack += je.getMessage() || "";
|
|
stack += "\n";
|
|
}
|
|
stack += e.stack;
|
|
return stack;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |