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

ruby-changes:30064

From: nagachika <ko1@a...>
Date: Tue, 23 Jul 2013 00:13:29 +0900 (JST)
Subject: [ruby-changes:30064] nagachika:r42116 (ruby_2_0_0): merge revision(s) 42103: [Backport #8662]

nagachika	2013-07-23 00:13:18 +0900 (Tue, 23 Jul 2013)

  New Revision: 42116

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

  Log:
    merge revision(s) 42103: [Backport #8662]
    
    * vm_eval.c (eval_string_with_cref): use the given file name unless
      eval even if scope is given.  additional fix for [Bug #8436].
      based on the patch by srawlins at [ruby-core:56099] [Bug #8662].

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/test/ruby/test_method.rb
    branches/ruby_2_0_0/version.h
    branches/ruby_2_0_0/vm_eval.c

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 42115)
+++ ruby_2_0_0/ChangeLog	(revision 42116)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Tue Jul 23 00:00:27 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_eval.c (eval_string_with_cref): use the given file name unless
+	  eval even if scope is given.  additional fix for [Bug #8436].
+	  based on the patch by srawlins at [ruby-core:56099] [Bug #8662].
+
 Sat Jul 20 23:49:33 2013  NAKAMURA Usaku  <usa@r...>
 
 	* test/drb/drbtest.rb (Drb{Core,Ary}#teardown): retry Process.kill
Index: ruby_2_0_0/vm_eval.c
===================================================================
--- ruby_2_0_0/vm_eval.c	(revision 42115)
+++ ruby_2_0_0/vm_eval.c	(revision 42116)
@@ -1198,7 +1198,10 @@ eval_string_with_cref(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_eval.c#L1198
 	    if (rb_obj_is_kind_of(scope, rb_cBinding)) {
 		GetBindingPtr(scope, bind);
 		envval = bind->env;
-		if (strcmp(file, "(eval)") == 0 && bind->path != Qnil) {
+		if (strcmp(file, "(eval)") != 0) {
+		    absolute_path = rb_str_new_cstr(file);
+		}
+		else if (bind->path != Qnil) {
 		    file = RSTRING_PTR(bind->path);
 		    line = bind->first_lineno;
 		    absolute_path = rb_current_realfilepath();
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 42115)
+++ ruby_2_0_0/version.h	(revision 42116)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2013-07-20"
-#define RUBY_PATCHLEVEL 273
+#define RUBY_RELEASE_DATE "2013-07-23"
+#define RUBY_PATCHLEVEL 274
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 20
+#define RUBY_RELEASE_DAY 23
 
 #include "ruby/version.h"
 
Index: ruby_2_0_0/test/ruby/test_method.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_method.rb	(revision 42115)
+++ ruby_2_0_0/test/ruby/test_method.rb	(revision 42116)
@@ -508,6 +508,8 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_method.rb#L508
     assert_equal(File.dirname(File.realpath(__FILE__)), __dir__)
     bug8436 = '[ruby-core:55123] [Bug #8436]'
     assert_equal(__dir__, eval("__dir__", binding), bug8436)
+    bug8662 = '[ruby-core:56099] [Bug #8662]'
+    assert_equal("arbitrary", eval("__dir__", binding, "arbitrary/file.rb"), bug8662)
   end
 
   def test_alias_owner

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r42103


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

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