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: 5ade4edadf4b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 59282835c408
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 25, 2016

  1. Copy the full SHA
    1b05d58 View commit details
  2. Copy the full SHA
    5928283 View commit details
Original file line number Diff line number Diff line change
@@ -98,11 +98,13 @@ public Object execute(VirtualFrame frame, String expression, Object... arguments
}

private boolean ensureConstantExpressionParameters(String expression, Object[] arguments) {
boolean test = this.expression == expression;
assert this.expression == expression :
"has to be always called with same expression: " + this.expression + " != " + expression;
for (int n = 0; n < parameters.length; n++) {
test = test && parameters[n] == arguments[2 * n];
assert parameters[n] == arguments[2 * n] :
"has to be always called with same parameter name at " + n + ": " + parameters[n] + " != " + arguments[2 * n];
}
return test;
return true;
}

@ExplodeLoop
Original file line number Diff line number Diff line change
@@ -38,7 +38,11 @@ public Source load(String canonicalPath) throws IOException {
} else if (canonicalPath.startsWith(TRUFFLE_SCHEME) || canonicalPath.startsWith(JRUBY_SCHEME)) {
return loadResource(canonicalPath);
} else {
assert new File(canonicalPath).getCanonicalPath().equals(canonicalPath) : canonicalPath;
final File file = new File(canonicalPath);
if (!file.canRead()) {
throw new IOException("Can't read file " + canonicalPath);
}
assert file.getCanonicalPath().equals(canonicalPath) : canonicalPath;
return Source.fromFileName(canonicalPath);
}
}