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: fefd7fa418d6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4b5cea6b6037
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 8, 2018

  1. Check third argument type

    to fix type cast error when last argument is not a hash.
    ChrisBr committed Jan 8, 2018
    Copy the full SHA
    8fcc4c9 View commit details
  2. Merge pull request #4952 from ChrisBr/feature/glob

    Check third argument type for Dir.glob
    enebo authored Jan 8, 2018
    Copy the full SHA
    4b5cea6 View commit details
Showing with 7 additions and 2 deletions.
  1. +7 −2 core/src/main/java/org/jruby/RubyDir.java
9 changes: 7 additions & 2 deletions core/src/main/java/org/jruby/RubyDir.java
Original file line number Diff line number Diff line change
@@ -216,8 +216,13 @@ public static IRubyObject glob(ThreadContext context, IRubyObject recv, IRubyObj

if(args.length == 3) {
flags = RubyNumeric.num2int(args[1]);
IRubyObject[] rets = ArgsUtil.extractKeywordArgs(context, (RubyHash) args[2], "base");
base = rets[0].convertToString().toString();
IRubyObject tmp = TypeConverter.checkHashType(runtime, args[2]);
if (tmp.isNil()){
throw runtime.newArgumentError("wrong number of arguments (" + args.length + " for 1..2)");
} else {
IRubyObject[] rets = ArgsUtil.extractKeywordArgs(context, (RubyHash) args[2], "base");
base = rets[0].convertToString().toString();
}
} else if(args.length == 2) {
IRubyObject tmp = TypeConverter.checkHashType(runtime, args[1]);
if(tmp.isNil()){