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

ruby-changes:45171

From: nobu <ko1@a...>
Date: Sun, 1 Jan 2017 18:08:00 +0900 (JST)
Subject: [ruby-changes:45171] nobu:r57244 (trunk): variable.c: top-level constant look-up

nobu	2017-01-01 18:07:56 +0900 (Sun, 01 Jan 2017)

  New Revision: 57244

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

  Log:
    variable.c: top-level constant look-up
    
    * variable.c (rb_const_search): [EXPERIMENTAL] remove top-level
      constant look-up.  [Feature #11547]

  Modified files:
    trunk/NEWS
    trunk/variable.c
Index: NEWS
===================================================================
--- NEWS	(revision 57243)
+++ NEWS	(revision 57244)
@@ -14,6 +14,8 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L14
 
 === Language changes
 
+* Top-level constant look-up is removed.  [Feature #11547]
+
 === Core classes updates (outstanding ones only)
 
 === Stdlib updates (outstanding ones only)
Index: variable.c
===================================================================
--- variable.c	(revision 57243)
+++ variable.c	(revision 57244)
@@ -2273,8 +2273,12 @@ rb_const_search(VALUE klass, ID id, int https://github.com/ruby/ruby/blob/trunk/variable.c#L2273
 		continue;
 	    }
 	    if (exclude && tmp == rb_cObject && klass != rb_cObject) {
+#if 0
 		rb_warn("toplevel constant %"PRIsVALUE" referenced by %"PRIsVALUE"::%"PRIsVALUE"",
 			QUOTE_ID(id), rb_class_name(klass), QUOTE_ID(id));
+#else
+		return Qundef;
+#endif
 	    }
 	    return value;
 	}

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

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