Skip to content

Commit 89619b3

Browse files
authored
dont produce warnings
1 parent 984462b commit 89619b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/engine/blocks.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,16 @@ class Blocks {
458458
if (!this._blocks.hasOwnProperty(e.blockId)) return;
459459

460460
// Don't accept delete events for most shadow blocks.
461+
const block = this._blocks[e.blockId];
461462
if (
462463
!e.isFromExpandable &&
463-
(this._blocks[e.blockId].shadow && !this._blocks[e.blockId].opcode.startsWith("argument_reporter_"))
464+
(block.shadow && !block.opcode.startsWith("argument_reporter_"))
464465
) {
465466
return;
466467
}
467468
// If this block is the initial block of a script, inform any runtime to forget about glows
468469
// as well as force end the script (if in compiler)
469-
if (this._blocks[e.blockId].topLevel) {
470+
if (block.topLevel) {
470471
this.runtime.quietGlow(e.blockId);
471472
if (this.runtime.compilerOptions.enabled) setTimeout(() => {
472473
// slighlty delay script end to handle tab switching vs real block deletion
@@ -476,7 +477,7 @@ class Blocks {
476477
}
477478
}, 100);
478479
}
479-
this.deleteBlock(e.blockId);
480+
this.deleteBlock(e.blockId, e.isFromExpandable || block.opcode.startsWith("argument_reporter_"));
480481
break;
481482
case 'var_create':
482483
this.resetCache(); // tw: more aggressive cache resetting

0 commit comments

Comments
 (0)