Skip to content

Commit

Permalink
few more deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl committed Aug 18, 2023
1 parent 7cea944 commit 90e1c23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions pxtblocks/code-validation/validateBlocksExist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,5 +36,4 @@ namespace pxt.blocks {
insufficientBlocks,
}
}

}
6 changes: 1 addition & 5 deletions pxtlib/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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++
Expand Down

0 comments on commit 90e1c23

Please sign in to comment.