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

fix a bug where oldNode was null on every step #79

Merged
merged 1 commit into from
Jan 22, 2017

Conversation

hmaurer
Copy link
Contributor

@hmaurer hmaurer commented Jan 20, 2017

Should fix #77. As far as I could see there was no point setting oldNode to null in Status.reset. The tests are still passing so I assume I didn't do something completely silly by removing it. Fingers crossed.

@evykassirer
Copy link
Contributor

yeah, I think this would fix it. Thanks for figuring that out!

I was trying to remember why the reset() function exists at all, to see if this change breaks anything, but it's only used in one place, so let's just scrap reset()?

So instead of this change, can you just delete the reset function, and then in simplifyExpression/stepThrough.js:

  • delete the line nodeStatus.reset();
  • change nodeStatus = step(nodeStatus.newNode); into
const nextNode = Status.resetChangeGroups(nodeStatus.newNode);
nodeStatus = step(nextNode);

(or something like that)

How's that sound?

@hmaurer
Copy link
Contributor Author

hmaurer commented Jan 21, 2017

Should be good to merge!

@@ -44,8 +44,8 @@ function stepThrough(node, debug=false) {
logSteps(nodeStatus);
}
steps.push(removeUnnecessaryParensInStep(nodeStatus));
nodeStatus.reset();
nodeStatus = step(nodeStatus.newNode);
const nextNode = Status.resetChangeGroups(nodeStatus.newNode);
Copy link
Contributor

Choose a reason for hiding this comment

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

merge your change to run tests+linter before committing ;D

you need to import Status here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops

Copy link
Contributor

Choose a reason for hiding this comment

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

np :) lemme know when it's ready!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be now! I had forgotten to push yesterday...

@evykassirer evykassirer merged commit c431aad into google:master Jan 22, 2017
arbylee pushed a commit to arbylee/mathsteps that referenced this pull request Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing mathsteps is not straightforward
2 participants