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

ruby-changes:33846

From: nagachika <ko1@a...>
Date: Mon, 12 May 2014 22:18:19 +0900 (JST)
Subject: [ruby-changes:33846] nagachika:r45927 (ruby_2_1): merge revision(s) r45360, r45361: [Backport #9651]

nagachika	2014-05-12 22:18:13 +0900 (Mon, 12 May 2014)

  New Revision: 45927

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

  Log:
    merge revision(s) r45360,r45361: [Backport #9651]
    
    * vm_eval.c (eval_string_with_cref): Use file path even if scope is
      given. Related to [ruby-core:56099] [Bug #8662] and r42103.
    
    * vm_eval.c (eval_string_with_cref): Unify to use NIL_P.

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/test/ruby/test_method.rb
    branches/ruby_2_1/version.h
    branches/ruby_2_1/vm_eval.c
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 45926)
+++ ruby_2_1/ChangeLog	(revision 45927)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon May 12 22:11:47 2014  Shota Fukumori  <her@s...>
+
+	* vm_eval.c (eval_string_with_cref): Unify to use NIL_P.
+
+Mon May 12 22:11:47 2014  Shota Fukumori  <her@s...>
+
+	* vm_eval.c (eval_string_with_cref): Use file path even if scope is
+	  given. Related to [ruby-core:56099] [Bug #8662] and r42103.
+
 Thu May  8 01:13:10 2014  NARUSE, Yui  <naruse@r...>
 
 	* configure.in: correct pthread_setname_np's prototype on NetBSD.
Index: ruby_2_1/vm_eval.c
===================================================================
--- ruby_2_1/vm_eval.c	(revision 45926)
+++ ruby_2_1/vm_eval.c	(revision 45927)
@@ -1218,14 +1218,15 @@ eval_string_with_cref(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_1/vm_eval.c#L1218
 	VALUE absolute_path = Qnil;
 	VALUE fname;
 
+	if (file != Qundef) {
+	    absolute_path = file;
+	}
+
 	if (scope != Qnil) {
 	    bind = Check_TypedStruct(scope, &ruby_binding_data_type);
 	    {
 		envval = bind->env;
-		if (file != Qundef) {
-		    absolute_path = file;
-		}
-		else if (!NIL_P(bind->path)) {
+		if (NIL_P(absolute_path) && !NIL_P(bind->path)) {
 		    file = bind->path;
 		    line = bind->first_lineno;
 		    absolute_path = rb_current_realfilepath();
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 45926)
+++ ruby_2_1/version.h	(revision 45927)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
-#define RUBY_RELEASE_DATE "2014-05-11"
-#define RUBY_PATCHLEVEL 97
+#define RUBY_RELEASE_DATE "2014-05-12"
+#define RUBY_PATCHLEVEL 98
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 11
+#define RUBY_RELEASE_DAY 12
 
 #include "ruby/version.h"
 
Index: ruby_2_1/test/ruby/test_method.rb
===================================================================
--- ruby_2_1/test/ruby/test_method.rb	(revision 45926)
+++ ruby_2_1/test/ruby/test_method.rb	(revision 45927)
@@ -660,6 +660,7 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_method.rb#L660
     assert_equal(__dir__, eval("__dir__", binding), bug8436)
     bug8662 = '[ruby-core:56099] [Bug #8662]'
     assert_equal("arbitrary", eval("__dir__", binding, "arbitrary/file.rb"), bug8662)
+    assert_equal("arbitrary", Object.new.instance_eval("__dir__", "arbitrary/file.rb"), bug8662)
   end
 
   def test_alias_owner

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r45360-45361


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

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