Skip to content

Commit 185d62e

Browse files
committed
Backport additional kwargs tweaks from 10
1 parent 41b9ba6 commit 185d62e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,12 @@ private static IRubyObject receiverSpecificArityKwargsCommon(ThreadContext conte
739739
// This complicates check_arity but empty ** is special case.
740740
RubyHash hash = (RubyHash) last;
741741
return hash;
742-
} else if (!isKwarg) {
743-
// This is just an ordinary hash as last argument
744-
return last;
745-
} else {
742+
} else if (isKwarg || ((RubyHash) last).isRuby2KeywordHash()) {
746743
RubyHash hash = (RubyHash) last;
747744
return hash.dupFast(context);
745+
} else {
746+
// This is just an ordinary hash as last argument
747+
return last;
748748
}
749749
}
750750

core/src/main/java/org/jruby/ir/targets/indy/InvokeSite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ private void finishBinding(CacheEntry entry, MethodHandle mh, IRubyObject self,
709709

710710
NativeCallMethod nativeMethod;
711711
if (method instanceof AbstractIRMethod) {
712-
// Ruby methods with ruby2_keywords don't use formal keywords
712+
// Ruby methods handle clearing kwargs flags on their own
713713
acceptsKeywords = true;
714714
} else if (method instanceof NativeCallMethod && (nativeMethod = (NativeCallMethod) method).getNativeCall() != null) {
715715
// native methods accept keywords only if specified

0 commit comments

Comments
 (0)