diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-28 08:06:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-28 08:06:33 +0000 |
commit | 7d085cca4be9c7292fbf58c75b2c49d7d06f79fe (patch) | |
tree | 66dbcfb35877765179efb3df544be942383012d9 /test/ruby/test_parse.rb | |
parent | efdc6d78acc6f5f0c43c82d6aa4a19856a1e0045 (diff) | |
download | ruby-7d085cca4be9c7292fbf58c75b2c49d7d06f79fe.tar.gz |
parse.y: fix line in rescue
* parse.y (set_line_body, primary): fix line number of bodystmt as
the beginning of the block. [ruby-core:79388] [Bug #13181]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index c2ee56ae52..09cb0cf2a5 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -965,6 +965,19 @@ x = __ENCODING__ end; end + def test_method_location_in_rescue + bug = '[ruby-core:79388] [Bug #13181]' + obj, line = Object.new, __LINE__+1 + def obj.location + # + raise + rescue + caller_locations(1, 1)[0] + end + + assert_equal(line, obj.location.lineno, bug) + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} |