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

Freeze Interpreter::Arguments instances #3138

Merged
merged 3 commits into from
Sep 10, 2020
Merged

Conversation

rmosolgo
Copy link
Owner

@rmosolgo rmosolgo commented Sep 9, 2020

Fixes #3004 , addresses issues described in #3003

TL;DR: it's possible to make mistakes where objects from the arguments cache are reused, even after they're modified in field-specific ways. This will make that impossible, since arguments objects can't be modified.

It could well be a breaking change, because arguments hashes won't play nicely with .delete anymore (as shown in updated test here, same goes for other destructive Hash methods).

@rmosolgo rmosolgo added this to the 1.12.0 milestone Sep 9, 2020
@rmosolgo rmosolgo changed the base branch from master to 1.12-dev September 9, 2020 13:16
end

resolved_arguments = resolved_arguments.merge_extras(extra_args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove the special handling of field extras in the arguments function since we're no longer mutating the arguments hash for that case? Also am I correct in assuming that the field extensions case in the arguments function no longer applies since field extensions can no longer mutate the arguments hash?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ahh, thanks for the reminder of that. I removed some special handling in f66a7f5, does that look right to you?

Copy link
Contributor

@jturkel jturkel left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@rmosolgo rmosolgo merged commit 7fb9846 into 1.12-dev Sep 10, 2020
@rmosolgo rmosolgo deleted the immutable-interpreter-args branch September 10, 2020 13:28
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.

Make Interpreter::Arguments immutable
2 participants