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

Commits on Mar 9, 2015

  1. Copy the full SHA
    ba1fceb View commit details
  2. Copy the full SHA
    6a73ac8 View commit details
Showing with 17 additions and 3 deletions.
  1. +9 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  2. +8 −3 truffle/src/main/ruby/core/rubinius/common/struct.rb
Original file line number Diff line number Diff line change
@@ -1533,6 +1533,15 @@ public Object raise(VirtualFrame frame, RubyClass exceptionClass, RubyString mes
throw new RaiseException((RubyException) exception);
}

// This provokes an error under standard Ruby:
// TypeError: backtrace must be Array of String
// but is used in Rubinius in coerce_to_failed for instance.
@Specialization
public Object raise(VirtualFrame frame, RubyClass exceptionClass, RubyString message, RubyException backtrace) {
// TODO (9 Mar. 2015): handle "backtrace" as an MRI "cause".
return raise(frame, exceptionClass, message, UndefinedPlaceholder.INSTANCE);
}

@Specialization
public Object raise(RubyException exception, UndefinedPlaceholder undefined1, UndefinedPlaceholder undefined2) {
throw new RaiseException(exception);
11 changes: 8 additions & 3 deletions truffle/src/main/ruby/core/rubinius/common/struct.rb
Original file line number Diff line number Diff line change
@@ -33,11 +33,16 @@ class << self

def self.new(klass_name, *attrs, &block)
if klass_name
begin
klass_name = StringValue klass_name
rescue TypeError
if klass_name.kind_of? Symbol # Truffle: added to avoid exception and match MRI
attrs.unshift klass_name
klass_name = nil
else
begin
klass_name = StringValue klass_name
rescue TypeError
attrs.unshift klass_name
klass_name = nil
end
end
end