mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-28 22:30:40 -04:00
Update to use explicit procedure names and ids
This commit is contained in:
parent
80b4dab104
commit
5a53323715
4 changed files with 12 additions and 11 deletions
|
@ -206,7 +206,7 @@ class Blocks {
|
|||
* @param {?string} name Name of procedure to query.
|
||||
* @return {?Array.<string>} List of param names for a procedure.
|
||||
*/
|
||||
getProcedureParamNames (name) {
|
||||
getProcedureParamNamesAndIds (name) {
|
||||
const cachedNames = this._cache.procedureParamNames[name];
|
||||
if (typeof cachedNames !== 'undefined') {
|
||||
return cachedNames;
|
||||
|
@ -217,9 +217,10 @@ class Blocks {
|
|||
const block = this._blocks[id];
|
||||
if (block.opcode === 'procedures_prototype' &&
|
||||
block.mutation.proccode === name) {
|
||||
const paramNames = JSON.parse(block.mutation.argumentnames);
|
||||
this._cache.procedureParamNames[name] = paramNames;
|
||||
return paramNames;
|
||||
const names = JSON.parse(block.mutation.argumentnames);
|
||||
const ids = JSON.parse(block.mutation.argumentids);
|
||||
this._cache.procedureParamNames[name] = [names, ids];
|
||||
return this._cache.procedureParamNames[name];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue