Skip to content

Commit

Permalink
Merge branch 'handle-class-skulpt' into lib
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienTainon committed Aug 28, 2024
2 parents 9895a49 + 68b2301 commit c6965f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/stepper/python/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const analyseSkulptScope = function(suspension: any, excludedVariableName
}

// This is an object of a class exported by a module, we don't want to display it in analysis
if ('object' === typeof value && value.__variableName) {
if ('object' === typeof value && value?.$d?.__variableName) {
continue;
}

Expand Down
3 changes: 2 additions & 1 deletion frontend/stepper/python/python_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ mod.${className} = Sk.misceval.buildClass(mod, newClass${className}, "${classNam
// Generate Python custom libraries from all generated blocks
log.getLogger('python_runner').debug('inject functions', this.availableBlocks);

this.definedConstants = [];

let blocksByGeneratorName: {[generatorName: string]: Block[]} = {};
for (let block of this.availableBlocks) {
if (block.generatorName) {
Expand Down Expand Up @@ -281,7 +283,6 @@ mod.${className} = Sk.misceval.buildClass(mod, newClass${className}, "${classNam
modContents += PythonRunner._skulptifyClassInstance(classInstance, className);
}

this.definedConstants = [];
for (let block of blocks.filter(block => block.type === BlockType.Constant)) {
const {name, value} = block;
modContents += PythonRunner._skulptifyConst(name, value);
Expand Down

0 comments on commit c6965f9

Please sign in to comment.