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: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c4babdd9d7c9^
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 235ee06382fb
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on May 25, 2015

  1. Copy the full SHA
    c4babdd View commit details
  2. Copy the full SHA
    235ee06 View commit details
Showing with 6 additions and 3 deletions.
  1. +3 −0 kernel/common/exception.rb
  2. +1 −1 kernel/common/throw_catch.rb
  3. +2 −2 spec/ruby/core/kernel/throw_spec.rb
3 changes: 3 additions & 0 deletions kernel/common/exception.rb
Original file line number Diff line number Diff line change
@@ -213,6 +213,9 @@ def to_s
end
end

class UncaughtThrowError < StandardError
end

class IndexError < StandardError
end

2 changes: 1 addition & 1 deletion kernel/common/throw_catch.rb
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ def catch(obj = Object.new, &block)

def throw(obj, value=nil)
unless Rubinius::ThrownValue.available? obj
raise ArgumentError, "uncaught throw #{obj.inspect}"
raise UncaughtThrowError, "uncaught throw #{obj.inspect}"
end

Rubinius.throw obj, value
4 changes: 2 additions & 2 deletions spec/ruby/core/kernel/throw_spec.rb
Original file line number Diff line number Diff line change
@@ -41,8 +41,8 @@
res.should == :return_value
end

it "raises an ArgumentError if there is no catch block for the symbol" do
lambda { throw :blah }.should raise_error(ArgumentError)
it "raises an UncaughtThrowError if there is no catch block for the symbol" do
lambda { throw :blah }.should raise_error(UncaughtThrowError)
end

it "raises ArgumentError if 3 or more arguments provided" do