Skip to content

Commit f96f013

Browse files
committed
eval_error.c: newline always
* eval_error.c (error_print): put a newline after an anonymous exception class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 4198f14 commit f96f013

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Thu Jun 26 02:45:04 2014 Nobuyoshi Nakada <[email protected]>
2+
3+
* eval_error.c (error_print): put a newline after an anonymous
4+
exception class name.
5+
16
Wed Jun 25 22:31:32 2014 Nobuyoshi Nakada <[email protected]>
27

38
* hash.c (ruby_setenv): fix memory leak on Windows, free

eval_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ error_print(void)
170170
}
171171
if (tail) {
172172
warn_print2(tail, elen - len - 1);
173-
if (einfo[elen-1] != '\n') warn_print2("\n", 1);
174173
}
174+
if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
175175
}
176176
}
177177

test/ruby/test_exception.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,4 +618,8 @@ def initialize(msg = nil)
618618
e = assert_raise(exc, bug) {raise exc, {}}
619619
assert_equal({}, e.arg, bug)
620620
end
621+
622+
def test_anonymous_message
623+
assert_in_out_err([], "raise Class.new(RuntimeError), 'foo'", [], /foo\n/)
624+
end
621625
end

0 commit comments

Comments
 (0)