Created
January 26, 2015 20:28
-
-
Save enebo/430a4e384ff4610dc517 to your computer and use it in GitHub Desktop.
This file contains 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
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