File tree Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Expand file tree Collapse file tree 2 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,10 @@ function reduceVMTest(
102
102
try {
103
103
stack = vmTest . vm . vmStack ( ) . reverse ( ) ;
104
104
} catch ( e ) {
105
- setStatus ( "Runtime error: Invalid stack" ) ;
105
+ dispatch . current ( {
106
+ action : "setError" ,
107
+ payload : new Error ( "Runtime error: Invalid stack" ) ,
108
+ } ) ;
106
109
}
107
110
108
111
return {
@@ -374,7 +377,7 @@ export function makeVmStore(
374
377
return done ;
375
378
} catch ( e ) {
376
379
setStatus ( `Runtime error: ${ ( e as Error ) . message } ` ) ;
377
- dispatch . current ( { action : "setValid " , payload : false } ) ;
380
+ dispatch . current ( { action : "setError " , payload : e } ) ;
378
381
return true ;
379
382
}
380
383
} ,
@@ -395,10 +398,11 @@ export function makeVmStore(
395
398
if ( animate ) {
396
399
dispatch . current ( { action : "update" } ) ;
397
400
}
401
+
398
402
return done ;
399
403
} catch ( e ) {
400
404
setStatus ( `Runtime error: ${ ( e as Error ) . message } ` ) ;
401
- dispatch . current ( { action : "setValid " , payload : false } ) ;
405
+ dispatch . current ( { action : "setError " , payload : e } ) ;
402
406
return true ;
403
407
}
404
408
} ,
Original file line number Diff line number Diff line change @@ -252,28 +252,25 @@ const VM = () => {
252
252
actions . setVm ( source ) ;
253
253
} }
254
254
language = { "vm" }
255
- highlight = {
256
- state . controls . valid && state . vm . showHighlight
257
- ? state . vm . highlight
258
- : undefined
259
- }
255
+ highlight = { state . vm . showHighlight ? state . vm . highlight : undefined }
256
+ highlightType = { state . controls . valid ? "highlight" : "error" }
260
257
error = { state . controls . error }
261
258
/>
262
259
</ Panel >
263
260
< Panel className = "vm" header = { < Trans > VM Structures</ Trans > } >
264
- { state . controls . valid && state . vm . Stack . length > 0 && (
265
- < >
261
+ < >
262
+ { state . vm . Stack . length > 0 && (
266
263
< VMStackFrame
267
264
statics = { state . vm . Statics }
268
265
temp = { state . vm . Temp }
269
266
frame = { state . vm . Stack [ 0 ] }
270
267
/>
271
- < CallStack
272
- stack = { state . vm . Stack }
273
- addedSysInit = { state . vm . AddedSysInit }
274
- />
275
- < />
276
- ) }
268
+ ) }
269
+ < CallStack
270
+ stack = { state . vm . Stack }
271
+ addedSysInit = { state . vm . AddedSysInit }
272
+ />
273
+ </ >
277
274
</ Panel >
278
275
< Panel className = "display" style = { { gridArea : "display" } } >
279
276
< Screen
You can’t perform that action at this time.
0 commit comments