File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -2453,20 +2453,12 @@ class Runtime extends EventEmitter {
24532453 this . threadMap . set ( thread . getId ( ) , thread ) ;
24542454 }
24552455
2456- // pm: Don't append a traceback to monitor threads.
2457- if ( ! opts ?. updateMonitor ) {
2458- thread . traceback = new Set ( opts ?. parent_thread ?. traceback ?? [ ] ) . add ( {
2459- target : thread . target . id ,
2460- block_id : thread . topBlock
2461- } ) ;
2462- }
2463-
24642456 // tw: compile new threads. Do not attempt to compile monitor threads.
24652457 if ( ! ( opts && opts . updateMonitor ) && this . compilerOptions . enabled ) {
24662458 thread . tryCompile ( ) ;
24672459 }
24682460
2469- this . emit ( Runtime . THREAD_STARTED , thread ) ;
2461+ this . emit ( Runtime . THREAD_STARTED , thread , opts ) ;
24702462 return thread ;
24712463 }
24722464
Original file line number Diff line number Diff line change @@ -162,6 +162,14 @@ class jgDebuggingBlocks {
162162 this . commandSet = { } ;
163163 this . commandExplanations = { } ;
164164
165+ runtime . on ( "THREAD_STARTED" , ( thread , options ) => {
166+ if ( options ?. updateMonitor ) return ;
167+ thread . traceback = new Set ( options ?. parent_thread ?. traceback ?? [ ] ) . add ( {
168+ target : thread . target . id ,
169+ block_id : thread . topBlock ,
170+ } ) ;
171+ } ) ;
172+
165173 this . isScratchBlocksReady = typeof ScratchBlocks === "object" ;
166174 this . ScratchBlocks = ScratchBlocks ;
167175 this . runtime . vm . on ( "workspaceUpdate" , ( ) => {
You can’t perform that action at this time.
0 commit comments