EmuHalt is squelched

nes: fixed loadState() npe
This commit is contained in:
Steven Hugg 2023-11-05 21:26:39 -06:00
parent 99370530f5
commit 3a08c24869
5 changed files with 14 additions and 2 deletions

View File

@ -584,6 +584,7 @@ $( ".dropdown-submenu" ).click(function(event) {
beforeSend(event, hint) { beforeSend(event, hint) {
const error = hint.originalException; const error = hint.originalException;
if (error && error.hasOwnProperty('$loc')) return null; // ignore EmuHalt if (error && error.hasOwnProperty('$loc')) return null; // ignore EmuHalt
if (error && error.squelchError) return null; // ignore EmuHalt
return event; return event;
}, },
}); });

View File

@ -4,8 +4,9 @@ export _8BITWS_SERVER_ROOT=/app
cd "$_8BITWS_SERVER_ROOT" cd "$_8BITWS_SERVER_ROOT"
curl -O https://sehugg.github.io/8bitworkshop/gen/server/server.js
while true; do while true; do
curl -O https://sehugg.github.io/8bitworkshop/gen/server/server.js
node server.js node server.js

View File

@ -270,7 +270,7 @@ export abstract class BaseDebugPlatform extends BasePlatform {
this.onBreakpointHit = callback; this.onBreakpointHit = callback;
} }
clearDebug() { clearDebug() {
if (this.debugBreakState != null) { if (this.debugBreakState != null && this.debugSavedState != null) {
this.loadState(this.debugSavedState); this.loadState(this.debugSavedState);
} }
this.debugSavedState = null; this.debugSavedState = null;

View File

@ -224,6 +224,7 @@ export class RAM {
export class EmuHalt extends Error { export class EmuHalt extends Error {
$loc : SourceLocation; $loc : SourceLocation;
squelchError = true;
constructor(msg: string, loc?: SourceLocation) { constructor(msg: string, loc?: SourceLocation) {
super(msg); super(msg);
this.$loc = loc; this.$loc = loc;

View File

@ -175,3 +175,12 @@ describe('Tokenizer', function () {
'ident ident code-fragment ident eof'); 'ident ident code-fragment ident eof');
}); });
}); });
describe('EmuHalt', function () {
try {
throw new EmuHalt("test");
} catch (err) {
assert.ok(err instanceof EmuHalt);
assert.ok(err.squelchError);
}
});