Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedures Don't Properly Handle Changing the Case of a Parameter #2592

Closed
BeksOmega opened this issue Jun 26, 2019 · 1 comment
Closed

Procedures Don't Properly Handle Changing the Case of a Parameter #2592

BeksOmega opened this issue Jun 26, 2019 · 1 comment
Labels
component: functions issue: bug Describes why the code or behaviour is wrong

Comments

@BeksOmega
Copy link
Collaborator

BeksOmega commented Jun 26, 2019

Problem statement

Changing the case of a procedure causes a console error because the code is calling a function that doesn't exist.

Expected Behavior

You should be able to change the case of a parameter without errors.

Actual Behavior

Errors!

Steps to Reproduce

  1. Create a procedure definition block.
  2. Open the mutator and add a paramter named lower case x ('x').
  3. Select this character and rename it to upper case x ('X').
  4. Observe the console error.

Stack Traces

procedures.js:592 Uncaught TypeError: outerWs.renameVarById is not a function
    at Blockly.FieldTextInput.validator_ (procedures.js:592)
    at Blockly.FieldTextInput.Blockly.Field.setValue (field.js:757)
    at Blockly.FieldTextInput.onHtmlInputChange_ (field_textinput.js:361)
    at HTMLInputElement.wrapFunc (blockly.js:481)

Operating System and Browser

I am assuming this is not browser specific.

Additional Information

This line should actually be this.getSourceBlock().renameVarById(model.getId(), varName);

When this is fixed the applicable procedure mocha test should be un-skipped.

@alschmiedt alschmiedt added affects: develop issue: bug Describes why the code or behaviour is wrong labels Jun 26, 2019
@BeksOmega
Copy link
Collaborator Author

BeksOmega commented Jun 26, 2019

Note: Even after you make the suggested change there are still problems with parameter renaming.

Parameter Renaming Bad

Tests should be added to cover the above case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: functions issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

No branches or pull requests

4 participants