Skip to content

Conversation

@mzgoddard
Copy link
Contributor

@mzgoddard mzgoddard commented Oct 5, 2018

Resolves

Parameters outside of their procedure definition always return 0.

Proposed Changes

Depends on #1642

  • Test that parameters outside of their procedure return 0.
  • argumentReporterStringNumber and argumentReporterBoolean should return 0 when the parameter cannot be found
  • If the first params object found on the stack does not have the parameter that is being looked up return null

Reason for Changes

Scratch 2 behaviour for parameters outside their procedure (or when the procedure is stack clicked) always returns 0.

Test Coverage

Added 6 integration tests to test parameters outside their procedure under a green flag event and under a different procedure.

@mzgoddard mzgoddard force-pushed the set-procedure-param-missing branch from 406db25 to fcafcbd Compare October 23, 2018 19:14
if (frame.params.hasOwnProperty(paramName)) {
return frame.params[paramName];
}
return null;

This comment was marked as abuse.

This comment was marked as abuse.

Copy link
Contributor

@kchadha kchadha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a minor question in the code comments.

@kchadha
Copy link
Contributor

kchadha commented Oct 25, 2018

@mzgoddard, I think this PR is good to go since you answered my question offline. I copied your answer in response to my comment in the code changes. I'm going to merge this in so that it can get smoke tested this Friday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants