mirror of
https://github.com/boxgaming/qbjs.git
synced 2024-04-29 01:30:13 +00:00
Added IDE support for error reporting (in addition to warning)
This commit is contained in:
parent
95b2be9d60
commit
0187c6ce84
21
qbjs-ide.js
21
qbjs-ide.js
|
@ -264,6 +264,14 @@ var IDE = new function() {
|
|||
|
||||
await displayWarnings();
|
||||
|
||||
if (_hasError()) {
|
||||
consoleVisible = true;
|
||||
window.onresize();
|
||||
QB.halt();
|
||||
GX.sceneStop();
|
||||
return false;
|
||||
}
|
||||
|
||||
_e.jsCode.innerHTML = jsCode;
|
||||
window.onresize();
|
||||
|
||||
|
@ -301,6 +309,16 @@ var IDE = new function() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function _hasError() {
|
||||
var warnings = QBCompiler.getWarnings();
|
||||
for (var i=0; i < warnings.length; i++) {
|
||||
if (warnings[i].mtype == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _stopProgram() {
|
||||
QB.halt();
|
||||
GX.sceneStop();
|
||||
|
@ -589,7 +607,8 @@ var IDE = new function() {
|
|||
var td1 = document.createElement("td");
|
||||
var td2 = document.createElement("td");
|
||||
var td3 = document.createElement("td");
|
||||
_addWarningCell(tr, "WARN");
|
||||
var mtype = (w[i].mtype == 1) ? "ERROR": "WARN";
|
||||
_addWarningCell(tr, mtype);
|
||||
_addWarningCell(tr, ":");
|
||||
_addWarningCell(tr, w[i].line);
|
||||
_addWarningCell(tr, ":");
|
||||
|
|
Loading…
Reference in a new issue