mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
return 0 from parameters outside of their procedure
This commit is contained in:
parent
afd2ed72c8
commit
fcafcbdd0a
2 changed files with 7 additions and 2 deletions
|
@ -54,7 +54,9 @@ class Scratch3ProcedureBlocks {
|
|||
argumentReporterStringNumber (args, util) {
|
||||
const value = util.getParam(args.VALUE);
|
||||
if (value === null) {
|
||||
return '';
|
||||
// When the parameter is not found in the most recent procedure
|
||||
// call, the default is always 0.
|
||||
return 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -62,7 +64,9 @@ class Scratch3ProcedureBlocks {
|
|||
argumentReporterBoolean (args, util) {
|
||||
const value = util.getParam(args.VALUE);
|
||||
if (value === null) {
|
||||
return false;
|
||||
// When the parameter is not found in the most recent procedure
|
||||
// call, the default is always 0.
|
||||
return 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -349,6 +349,7 @@ class Thread {
|
|||
if (frame.params.hasOwnProperty(paramName)) {
|
||||
return frame.params[paramName];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue