Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 75c60c8602c1
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02c3dd8dfe38
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jun 1, 2015

  1. Copy the full SHA
    2dcb163 View commit details
  2. arity.toString() was printing extra crap and not just its value. Swit…

    …ch to using value in error message
    enebo committed Jun 1, 2015
    Copy the full SHA
    02c3dd8 View commit details
Showing with 3 additions and 7 deletions.
  1. +3 −5 core/src/main/java/org/jruby/RubyClass.java
  2. +0 −2 test/mri/excludes/TestObject.rb
8 changes: 3 additions & 5 deletions core/src/main/java/org/jruby/RubyClass.java
Original file line number Diff line number Diff line change
@@ -657,18 +657,16 @@ private static IRubyObject checkFuncallFailed(ThreadContext context, IRubyObject
*/
private static boolean checkFuncallRespondTo(ThreadContext context, RubyClass klass, IRubyObject recv, String mid) {
Ruby runtime = context.runtime;
RubyClass defined_class;
DynamicMethod me = klass.searchMethod("respond_to?");

// NOTE: isBuiltin here would be NOEX_BASIC in MRI, a flag only added to respond_to?, method_missing, and
// respond_to_missing? Same effect, I believe.
if (me != null && !me.isUndefined() && !me.isBuiltin()) {
Arity arity = me.getArity();
int arityValue = me.getArity().getValue();

if (arity.getValue() > 2)
throw runtime.newArgumentError("respond_to? must accept 1 or 2 arguments (requires " + arity + ")");
if (arityValue > 2) throw runtime.newArgumentError("respond_to? must accept 1 or 2 arguments (requires " + arityValue + ")");

IRubyObject result = me.call(context, recv, klass, "respond_to?", runtime.newString(mid), runtime.getTrue());
IRubyObject result = me.call(context, recv, klass, "respond_to?", runtime.newSymbol(mid), runtime.getTrue());
if (!result.isTrue()) {
return false;
}
2 changes: 0 additions & 2 deletions test/mri/excludes/TestObject.rb
Original file line number Diff line number Diff line change
@@ -3,6 +3,4 @@

exclude :test_redefine_method_under_verbose, "needs warning message"
exclude :test_redefine_method_which_may_case_serious_problem, "needs warning message"
exclude :test_implicit_respond_to, "needs investigation"
exclude :test_implicit_respond_to_arity_3, "needs investigation"
exclude :test_implicit_respond_to_arity_1, "needs investigation"