mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
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
This commit is contained in:
parent
efdc6d78ac
commit
7d085cca4b
2 changed files with 30 additions and 3 deletions
|
@ -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")}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue