[前][次][番号順一覧][スレッド一覧]

ruby-changes:34470

From: nobu <ko1@a...>
Date: Thu, 26 Jun 2014 02:45:18 +0900 (JST)
Subject: [ruby-changes:34470] nobu:r46551 (trunk): eval_error.c: newline always

nobu	2014-06-26 02:45:10 +0900 (Thu, 26 Jun 2014)

  New Revision: 46551

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46551

  Log:
    eval_error.c: newline always
    
    * eval_error.c (error_print): put a newline after an anonymous
      exception class name.

  Modified files:
    trunk/ChangeLog
    trunk/eval_error.c
    trunk/test/ruby/test_exception.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46550)
+++ ChangeLog	(revision 46551)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 26 02:45:04 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* eval_error.c (error_print): put a newline after an anonymous
+	  exception class name.
+
 Wed Jun 25 22:31:32 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* hash.c (ruby_setenv): fix memory leak on Windows, free
Index: eval_error.c
===================================================================
--- eval_error.c	(revision 46550)
+++ eval_error.c	(revision 46551)
@@ -170,8 +170,8 @@ error_print(void) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L170
 	    }
 	    if (tail) {
 		warn_print2(tail, elen - len - 1);
-		if (einfo[elen-1] != '\n') warn_print2("\n", 1);
 	    }
+	    if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
 	}
     }
 
Index: test/ruby/test_exception.rb
===================================================================
--- test/ruby/test_exception.rb	(revision 46550)
+++ test/ruby/test_exception.rb	(revision 46551)
@@ -618,4 +618,8 @@ end.join https://github.com/ruby/ruby/blob/trunk/test/ruby/test_exception.rb#L618
     e = assert_raise(exc, bug) {raise exc, {}}
     assert_equal({}, e.arg, bug)
   end
+
+  def test_anonymous_message
+    assert_in_out_err([], "raise Class.new(RuntimeError), 'foo'", [], /foo\n/)
+  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]