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

Commits on Dec 9, 2014

  1. Copy the full SHA
    9d3217f View commit details
  2. Copy the full SHA
    6fcfcef View commit details
  3. Copy the full SHA
    01689a2 View commit details
13 changes: 11 additions & 2 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -508,7 +508,7 @@ public Object eval(RubyString source, RubyBinding binding) {
return getContext().eval(source.toString(), binding, this);
}

@Specialization(guards = "!isString(arguments[0])")
@Specialization(guards = "!isRubyString(arguments[0])")
public Object eval(VirtualFrame frame, RubyBasicObject object, @SuppressWarnings("unused") UndefinedPlaceholder binding) {
notDesignedForCompilation();

@@ -518,7 +518,7 @@ public Object eval(VirtualFrame frame, RubyBasicObject object, @SuppressWarnings
return eval(frame, object, defaultBinding);
}

@Specialization(guards = "!isString(arguments[0])")
@Specialization(guards = "!isRubyString(arguments[0])")
public Object eval(VirtualFrame frame, RubyBasicObject object, RubyBinding binding) {
notDesignedForCompilation();

@@ -549,6 +549,15 @@ public Object eval(VirtualFrame frame, RubyBasicObject object, RubyBinding bindi
this));
}
}

@Specialization(guards = "!isRubyBinding(arguments[1])")
public Object eval(@SuppressWarnings("unused") RubyBasicObject source, RubyBasicObject badBinding) {
throw new RaiseException(
getContext().getCoreLibrary().typeError(
String.format("wrong argument type %s (expected binding)",
badBinding.getLogicalClass().getName()),
this));
}
}

@CoreMethod(names = "exec", isModuleFunction = true, required = 1, argumentsAsArray = true)
1 change: 0 additions & 1 deletion spec/truffle/tags/core/kernel/eval_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
fails:Kernel#eval evaluates within the scope of the eval
fails:Kernel#eval evaluates such that consts are scoped to the class of the eval
fails:Kernel#eval doesn't accept a Proc object as a binding
fails:Kernel#eval allows a binding to be captured inside an eval
fails:Kernel#eval uses the same scope for local variables when given the same binding
fails:Kernel#eval includes file and line information in syntax error
1 change: 0 additions & 1 deletion spec/truffle/tags/language/BEGIN_tags.txt

This file was deleted.