diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-03 01:46:59 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-03 01:46:59 +0000 |
commit | 86bfcc2da07d524845fbfb3a458a84cc8bd3ecf1 (patch) | |
tree | f8253548080292e640e2405031c706cdff25b3f5 /test | |
parent | 1281e56682692859e726e24fff30e44aac6f948b (diff) |
merge revision(s) 58499,58500: [Backport #13181]
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]
parse.y: set_line_body is not used in ripper
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@60626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 18e7d8f87c..78a7ab8c90 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -980,6 +980,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")}} |