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

Don't try to dup the String class #1038

Closed
wants to merge 2 commits into from

Conversation

rnubel
Copy link
Contributor

@rnubel rnubel commented Jun 19, 2015

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:

  • Is this change worth making? The issue likely doesn't affect too many people, but the fix would apply to everyone.
  • If yes to the above, should it be pushed up to ActiveSupport and/or left as a monkey-patch in Grape?
  • Are there other classes in Rubinius with landmines like this one?

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).
@dblock
Copy link
Member

dblock commented Jun 19, 2015

Oh wow, this is interesting. I vote to merge it, but I would like a CHANGELOG entry, please.

@rnubel
Copy link
Contributor Author

rnubel commented Jun 20, 2015

Changelog updated. Also, I've submitted an upstream patch to Rails for this: rails/rails#20640

@dblock
Copy link
Member

dblock commented Jun 20, 2015

Merged squashed via a37df3e.

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.

2 participants