Don't try to dup the String class#1038
Closed
rnubel wants to merge 2 commits into
Closed
Conversation
Rubinius will raise a TypeError, should you try String.dup, whereas MRI has no problem with it. As such, this change marks String as un- duplicable with respect to ActiveSupports' #duplicable? method, used by #deep_dup. Since this change isn't in upstream ActiveSupport, I also forced the backport to always be loaded (this could be changed to just a monkeypatch of the String class, though).
Member
|
Oh wow, this is interesting. I vote to merge it, but I would like a CHANGELOG entry, please. |
Contributor
Author
|
Changelog updated. Also, I've submitted an upstream patch to Rails for this: rails/rails#20640 |
Member
|
Merged squashed via a37df3e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #873 by preventing ActiveSupport#deep_dup from trying to duplicate the String class (note: I mean strictly the String class, not String instances). However, there are a few points to consider: