mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -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) {
|
argumentReporterStringNumber (args, util) {
|
||||||
const value = util.getParam(args.VALUE);
|
const value = util.getParam(args.VALUE);
|
||||||
if (value === null) {
|
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;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +64,9 @@ class Scratch3ProcedureBlocks {
|
||||||
argumentReporterBoolean (args, util) {
|
argumentReporterBoolean (args, util) {
|
||||||
const value = util.getParam(args.VALUE);
|
const value = util.getParam(args.VALUE);
|
||||||
if (value === null) {
|
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;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,6 +349,7 @@ class Thread {
|
||||||
if (frame.params.hasOwnProperty(paramName)) {
|
if (frame.params.hasOwnProperty(paramName)) {
|
||||||
return frame.params[paramName];
|
return frame.params[paramName];
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue