Skip to content

Commit 092756c

Browse files
committed
Fixed uses of getAllVariables and getVariableUsesById, which are deprecated in v12 and will be deleted in v13.
1 parent 6ee74ea commit 092756c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/editor/extended_python_generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ export class ExtendedPythonGenerator extends PythonGenerator {
248248
exportedBlocks.push(callFunctionBlock);
249249
}
250250

251-
const allVariables = workspace.getAllVariables();
251+
const allVariables = workspace.getVariableMap().getAllVariables();
252252
for (const variableModel of allVariables) {
253253
// Only variables that are used outside of functions are exported. (I'm not sure if this is
254254
// the right choice, since all blockly variables are global variables.)
255255
let exported = false;
256-
const variableUsesById = workspace.getVariableUsesById(variableModel.getId())
256+
const variableUsesById = workspace.getVariableMap().getVariableUsesById(variableModel.getId())
257257
if (variableUsesById.length === 0) {
258258
continue;
259259
}

0 commit comments

Comments
 (0)