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

Commits on Dec 8, 2014

  1. Copy the full SHA
    a4c9ce1 View commit details
  2. Copy the full SHA
    4702337 View commit details
  3. Copy the full SHA
    c774d2f View commit details
Showing with 14 additions and 4 deletions.
  1. +14 −4 core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
18 changes: 14 additions & 4 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -492,13 +492,13 @@ public EvalNode(EvalNode prev) {
}

@Specialization
public Object eval(VirtualFrame frame, RubyString source, @SuppressWarnings("unused") UndefinedPlaceholder binding) {
public Object eval(RubyString source, @SuppressWarnings("unused") UndefinedPlaceholder binding) {
notDesignedForCompilation();

RubyBinding newBinding = (RubyBinding) KernelNodesFactory.BindingNodeFactory.create(getContext(),
RubyBinding defaultBinding = (RubyBinding) KernelNodesFactory.BindingNodeFactory.create(getContext(),
getSourceSection(), null).binding();

return getContext().eval(source.toString(), newBinding, this);
return eval(source, defaultBinding);
}

@Specialization
@@ -512,6 +512,16 @@ public Object eval(RubyString source, RubyBinding binding) {
public Object eval(VirtualFrame frame, RubyBasicObject object, @SuppressWarnings("unused") UndefinedPlaceholder binding) {
notDesignedForCompilation();

RubyBinding defaultBinding = (RubyBinding) KernelNodesFactory.BindingNodeFactory.create(getContext(),
getSourceSection(), null).binding();

return eval(frame, object, defaultBinding);
}

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

Object coerced;

try {
@@ -528,7 +538,7 @@ public Object eval(VirtualFrame frame, RubyBasicObject object, @SuppressWarnings
}

if (coerced instanceof RubyString) {
return getContext().eval(coerced.toString(), this);
return getContext().eval(coerced.toString(), binding, this);
} else {
throw new RaiseException(
getContext().getCoreLibrary().typeError(