Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce risk of hitting bug 12832 in Ruby v2.3
Fixes #277. This mirrors the change to `ClassMethod#hide_original_method` in 6f1c8b9. This serves two purposes: 1. Make the implementation of `AnyInstanceMethod#hide_original_method` closer to `ClassMethod#hide_original_method`. 2. Avoid the possibility of hitting Ruby bug 12832[1]. While I'm fairly confident that calling `#instance_method` can trigger the bug in Ruby I'm not convinced that it can be triggered by the code in `AnyInstanceMethod#hide_original_method`. The bug appears to be triggered when calling class methods and I'm not aware of a way to use `any_instance_of` to stub class methods. [1]: https://bugs.ruby-lang.org/issues/12832
- Loading branch information