1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-22 12:30:01 +00:00

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) {
const error = hint.originalException;
if (error && error.hasOwnProperty('$loc')) return null; // ignore EmuHalt
if (error && error.squelchError) return null; // ignore EmuHalt
return event;
},
});

View File

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

View File

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

View File

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

View File

@ -175,3 +175,12 @@ describe('Tokenizer', function () {
'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);
}
});