Skip to content

Commit

Permalink
Merge pull request #11170 from hassnian/issue-11169
Browse files Browse the repository at this point in the history
fix: Error createCanvas function not found
  • Loading branch information
vikiival authored Oct 29, 2024
2 parents b839e6f + 49c6e5e commit 0439e14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/codeChecker/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const constants = {
const validateCanvasCreation = (
sketchFileContent: string,
): Result<RegExpExecArray> => {
const canvasMatch = constants.canvasRegex.exec(sketchFileContent)
// Create a new regex instance to avoid issues with lastIndex when using the global flag.
const canvasMatch = new RegExp(constants.canvasRegex).exec(sketchFileContent)
if (!canvasMatch) {
return { isSuccess: false, error: 'createCanvas function not found.' }
}
Expand Down

0 comments on commit 0439e14

Please sign in to comment.