From dc40d1b040cb271bd1c91b943fabb4d13ad642c6 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Fri, 6 Jul 2018 01:42:01 -0500 Subject: [PATCH] fixed bug where errors pile up --- doc/notes.txt | 1 + index.html | 8 +++++--- src/platform/nes.js | 1 + src/project.ts | 8 +++++--- src/ui.js | 10 ++++------ src/views.ts | 1 + 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/doc/notes.txt b/doc/notes.txt index 4781c0ad..b5054c7c 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -44,6 +44,7 @@ TODO: - unify versioning - more UI tests - base-36 encoding for LZG +- disassembler for uploaded ROMs WEB WORKER FORMAT diff --git a/index.html b/index.html index 7ec150a4..c5d2a890 100644 --- a/index.html +++ b/index.html @@ -26,9 +26,11 @@ body { diff --git a/src/platform/nes.js b/src/platform/nes.js index 9b825a29..13fa7c8d 100644 --- a/src/platform/nes.js +++ b/src/platform/nes.js @@ -5,6 +5,7 @@ var NES_NESLIB_PRESETS = [ {id:'neslib2.c', name:'Sprites'}, {id:'neslib3.c', name:'Cursor'}, {id:'neslib4.c', name:'Metasprites'}, + {id:'chase/game.c', name:'Chase (example game)'}, ]; var NES_CONIO_PRESETS = [ diff --git a/src/project.ts b/src/project.ts index c70f3aae..62f2c812 100644 --- a/src/project.ts +++ b/src/project.ts @@ -126,7 +126,8 @@ export class CodeProject { this.tools_preloaded[tool] = true; } } - + + // TODO: support link-time and compile-time (include) dependencies parseFileDependencies(text:string):string[] { var files = []; if (this.platform_id == 'verilog') { @@ -192,7 +193,7 @@ export class CodeProject { } else { this.store.getItem(path, (err, value) => { if (err) { - callback(err); + callback(err, result); } else if (value) { result.push({ path:path, @@ -217,7 +218,7 @@ export class CodeProject { loadNext(); }, 'text') .fail(function() { - callback("Could not load preset " + path); + callback("Could not load preset " + path, result); }); } }); @@ -244,6 +245,7 @@ export class CodeProject { if (err) { console.log(err); // TODO? } + if (!depends) depends = []; if (this.platform_id == 'verilog') { // TODO: should get rid of this msg format this.worker.postMessage({ diff --git a/src/ui.js b/src/ui.js index 8eeadf73..eb17597c 100644 --- a/src/ui.js +++ b/src/ui.js @@ -748,12 +748,10 @@ function installErrorHandler() { window.onerror = function (msgevent, url, line, col, error) { console.log(msgevent, url, line, col); console.log(error); - if (window.location.host.endsWith('8bitworkshop.com')) { - ga('send', 'exception', { - 'exDescription': msgevent + " " + url + " " + " " + line + ":" + col + ", " + error, - 'exFatal': true - }); - } + ga('send', 'exception', { + 'exDescription': msgevent + " " + url + " " + " " + line + ":" + col + ", " + error, + 'exFatal': true + }); alert(msgevent+""); }; } diff --git a/src/views.ts b/src/views.ts index cf819ab8..6accb46d 100644 --- a/src/views.ts +++ b/src/views.ts @@ -114,6 +114,7 @@ function SourceEditor(path, mode) { editor.clearGutter("gutter-info"); refreshDebugState(); dirtylisting = true; + lines2errmsg = []; } self.getSourceFile = function() { return sourcefile; }