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 0b4547e + dbe0220 commit 9895a49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions frontend/stepper/python/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,9 @@ const variablesBeginWithIgnore = [

/**
* Filter the variable names by removing those used internally by Skulpt.
*
* @param {Array} variableNames The names.
*
* @returns {Array}
*/
const filterInternalVariables = (variableNames: string[], excludedVariableNames: string[]): string[] => {
console.log('filter internal variables', {variableNames, excludedVariableNames})
return variableNames.filter((name) => {
if (-1 !== excludedVariableNames.indexOf(name)) {
return false;
Expand Down
4 changes: 3 additions & 1 deletion frontend/stepper/python/python_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ mod.${moduleMethodName ?? name} = new Sk.builtin.func(function () {
private static _skulptifyClassInstance(classInstance: string, className: string) {
return `
mod.${classInstance} = Sk.misceval.callsimArray(mod.${className});
mod.${classInstance}.__variableName = '${classInstance}';
mod.${classInstance}.$d.__variableName = '${classInstance}';
`;
}

Expand Down Expand Up @@ -288,6 +288,8 @@ mod.${className} = Sk.misceval.buildClass(mod, newClass${className}, "${classNam
this.definedConstants.push(name);
}

console.log('defined constants', blocks);

modContents += "\nreturn mod;\n};";
Sk.builtinFiles["files"]["src/lib/" + generatorName + ".js"] = modContents;
this.availableModules.push(generatorName);
Expand Down

0 comments on commit 9895a49

Please sign in to comment.