Skip to content

Commit 4db0c8a

Browse files
authored
Merge pull request jruby#9215 from headius/data_new_empty_kwrest
Ignore empty kwrest in Data subtypes' constructors
2 parents 05ae525 + 7cccb7e commit 4db0c8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/main/java/org/jruby/RubyData.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import static org.jruby.runtime.Arity.checkArgumentCount;
4141
import static org.jruby.runtime.Helpers.invokedynamic;
4242
import static org.jruby.runtime.ThreadContext.CALL_KEYWORD;
43+
import static org.jruby.runtime.ThreadContext.CALL_KEYWORD_EMPTY;
4344
import static org.jruby.runtime.ThreadContext.clearCallInfo;
4445
import static org.jruby.runtime.ThreadContext.hasKeywords;
4546
import static org.jruby.runtime.ThreadContext.resetCallInfo;
@@ -309,7 +310,7 @@ public static IRubyObject rbNew(ThreadContext context, IRubyObject self, IRubyOb
309310

310311
RubyHash init;
311312
int callInfo = resetCallInfo(context);
312-
if (hasKeywords(callInfo)) {
313+
if (hasKeywords(callInfo) && (callInfo & CALL_KEYWORD_EMPTY) == 0) {
313314
if (!(hashOrElt instanceof RubyHash)) {
314315
throw argumentError(context, 1, 0, 0);
315316
}

0 commit comments

Comments
 (0)