Skip to content

Instantly share code, notes, and snippets.

@enebo
Created January 26, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enebo/430a4e384ff4610dc517 to your computer and use it in GitHub Desktop.
Save enebo/430a4e384ff4610dc517 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java b/core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java
index 8a3a8fa..57558db 100644
--- a/core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java
+++ b/core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java
@@ -1,6 +1,7 @@
package org.jruby.runtime;
import org.jruby.EvalType;
+import org.jruby.RubyHash;
import org.jruby.ir.IRClosure;
import org.jruby.ir.IRFlags;
import org.jruby.ir.interpreter.Interpreter;
@@ -70,6 +71,16 @@ public class InterpretedIRBlockBody extends IRBlockBody {
}
this.evalType.set(EvalType.NONE);
+ if (ic.receivesKeywordArguments()) {
+ RubyHash kwargs = IRRuntimeHelpers.extractKwargsHash(args, signature.required(), true);
+
+ if (kwargs != null) {
+ kwargs = (RubyHash) kwargs.dup(context);
+ kwargs.setFrozen(false);
+ args[args.length - 1] = kwargs;
+ }
+ }
+
try {
return Interpreter.INTERPRET_BLOCK(context, self, ic, args, binding.getMethod(), block, type);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment