@@ -38,6 +38,7 @@ import type {
3838import { Msg } from '../core/msg.js' ;
3939import { Names } from '../core/names.js' ;
4040import * as Procedures from '../core/procedures.js' ;
41+ import * as deprecation from '../core/utils/deprecation.js' ;
4142import * as xmlUtils from '../core/utils/xml.js' ;
4243import * as Variables from '../core/variables.js' ;
4344import type { Workspace } from '../core/workspace.js' ;
@@ -345,9 +346,17 @@ const PROCEDURE_DEF_COMMON = {
345346 /**
346347 * Return all variables referenced by this block.
347348 *
349+ * @deprecated v13: Use Blockly.libraryBlocks.procedures.getVarModels()
350+ * .map(m => m.getName())
348351 * @returns List of variable names.
349352 */
350353 getVars : function ( this : ProcedureBlock ) : string [ ] {
354+ deprecation . warn (
355+ 'Blockly.libraryBlocks.procedures.getVars()' ,
356+ 'v13' ,
357+ 'v14' ,
358+ 'Blockly.libraryBlocks.procedures.getVarModels().map(model => model.getName())' ,
359+ ) ;
351360 return this . arguments_ ;
352361 } ,
353362 /**
@@ -1020,9 +1029,17 @@ const PROCEDURE_CALL_COMMON = {
10201029 /**
10211030 * Return all variables referenced by this block.
10221031 *
1032+ * @deprecated v13: Use Blockly.libraryBlocks.procedures.getVarModels()
1033+ * .map(m => m.getName())
10231034 * @returns List of variable names.
10241035 */
10251036 getVars : function ( this : CallBlock ) : string [ ] {
1037+ deprecation . warn (
1038+ 'Blockly.libraryBlocks.procedures.getVars()' ,
1039+ 'v13' ,
1040+ 'v14' ,
1041+ 'Blockly.libraryBlocks.procedures.getVarModels().map(model => model.getName())' ,
1042+ ) ;
10261043 return this . arguments_ ;
10271044 } ,
10281045 /**
@@ -1060,7 +1077,8 @@ const PROCEDURE_CALL_COMMON = {
10601077 if (
10611078 def &&
10621079 ( def . type !== this . defType_ ||
1063- JSON . stringify ( def . getVars ( ) ) !== JSON . stringify ( this . arguments_ ) )
1080+ JSON . stringify ( def . getVarModels ( ) . map ( ( model ) => model . getName ( ) ) ) !==
1081+ JSON . stringify ( this . arguments_ ) )
10641082 ) {
10651083 // The signatures don't match.
10661084 def = null ;
0 commit comments