diff --git a/pxtblocks/code-validation/validateBlocksExist.ts b/pxtblocks/code-validation/validateBlocksExist.ts index 996a402c59fd..533c2faa74ba 100644 --- a/pxtblocks/code-validation/validateBlocksExist.ts +++ b/pxtblocks/code-validation/validateBlocksExist.ts @@ -16,7 +16,7 @@ namespace pxt.blocks { return acc; }, {}); - for (const [requiredBlockId, requiredCount] of Object.entries(requiredBlockCounts)) { + for (const [requiredBlockId, requiredCount] of Object.entries(requiredBlockCounts || {})) { const countForBlock = userBlocksEnabledByType[requiredBlockId]; if (countForBlock === undefined) { // user did not use a specific block @@ -36,5 +36,4 @@ namespace pxt.blocks { insufficientBlocks, } } - } \ No newline at end of file diff --git a/pxtlib/tutorial.ts b/pxtlib/tutorial.ts index ed5945ed5e7e..eb716ed14d04 100644 --- a/pxtlib/tutorial.ts +++ b/pxtlib/tutorial.ts @@ -63,7 +63,7 @@ namespace pxt.tutorial { } export function getMetadataRegex(): RegExp { - return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|tutorialValidationRules|requiredTutorialBlock|simtheme)\s*\n([\s\S]*?)\n```/gmi; + return /``` *(sim|block|blocks|filterblocks|spy|ghost|typescript|ts|js|javascript|template|python|jres|assetjson|customts|simtheme)\s*\n([\s\S]*?)\n```/gmi; } function computeBodyMetadata(body: string) { @@ -88,7 +88,6 @@ namespace pxt.tutorial { case "blocks": case "blockconfig.local": case "blockconfig.global": - case "requiredTutorialBlock": case "filterblocks": if (!checkTutorialEditor(pxt.BLOCKS_PROJECT_NAME)) return undefined; @@ -123,9 +122,6 @@ namespace pxt.tutorial { customTs = m2; m2 = ""; break; - case "tutorialValidationRules": - // DEPRECATED: Unused, replaced with new code validation - break; } code.push(m1 == "python" ? `\n${m2}\n` : `{\n${m2}\n}`); idx++