diff --git a/packages/block/src/events/func_base.ts b/packages/block/src/events/func_base.ts index ea2a60c2..17bac3ff 100644 --- a/packages/block/src/events/func_base.ts +++ b/packages/block/src/events/func_base.ts @@ -15,7 +15,7 @@ export class FuncBase extends Blockly.Events.Abstract { override isBlank: boolean = false; /** The procCode of procedure. */ - protected procCode?: string; + procCode?: string; /** * @param procedure The procedure model. diff --git a/packages/vm/src/engine/blocks.ts b/packages/vm/src/engine/blocks.ts index aa79ad8b..09d6a35c 100644 --- a/packages/vm/src/engine/blocks.ts +++ b/packages/vm/src/engine/blocks.ts @@ -381,7 +381,8 @@ class Blocks { if ( typeof (event as ClipCCBlock.Events.BlockBase).blockId !== 'string' && typeof (event as ClipCCBlock.Events.VarBase).varId !== 'string' && - typeof (event as ClipCCBlock.Events.CommentBase).commentId !== 'string' + typeof (event as ClipCCBlock.Events.CommentBase).commentId !== 'string' && + typeof (event as ClipCCBlock.FuncChange).procCode !== 'string' ) { return; } diff --git a/packages/vm/src/serialization/migration.js b/packages/vm/src/serialization/migration.js index bc2057be..7989c4b8 100644 --- a/packages/vm/src/serialization/migration.js +++ b/packages/vm/src/serialization/migration.js @@ -102,7 +102,7 @@ const migrateMutation = (block, backward) => { case 'return': case 'generateshadows': // Expect mutation[key] to be a string. - mutation[key] = (mutation[key] === 'true'); + mutation[key] = typeof mutation[key] === 'string' ? (mutation[key] === 'true') : !!mutation[key]; break; case 'argumentids': case 'argumentnames':