* eval.c (rb_mod_refine, mod_using, top_using): don't show

warnings because Refinements are no longer experimental.
  [ruby-core:55993] [Feature #8632]

* test/ruby/test_refinement.rb: related test.

* NEWS: fixes for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2013-07-31 09:29:40 +00:00
Родитель b30a172385
Коммит 1c7f9073b0
4 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -1,3 +1,13 @@
Wed Jul 31 18:24:02 2013 Shugo Maeda <shugo@ruby-lang.org>
* eval.c (rb_mod_refine, mod_using, top_using): don't show
warnings because Refinements are no longer experimental.
[ruby-core:55993] [Feature #8632]
* test/ruby/test_refinement.rb: related test.
* NEWS: fixes for the above change.
Wed Jul 31 17:55:55 2013 Shota Fukumori <her@sorah.jp>
* lib/uri/common.rb (URI.decode_www_form_component):

7
NEWS
Просмотреть файл

@ -30,6 +30,8 @@ with all sufficient information, see the ChangeLog file.
* New methods:
* Module#using, which activates refinements of the specified module only
in the current class or module definition.
* extended methods:
* Module#refine is no longer experimental.
* Mutex
* misc
@ -48,8 +50,9 @@ with all sufficient information, see the ChangeLog file.
* toplevel
* extended methods:
* main.using activates refinements in the ancestors of the argument
module to support refinement inheritance by Module#include.
* main.using is no longer experimental. The method activates refinements
in the ancestors of the argument module to support refinement
inheritance by Module#include.
=== Core classes compatibility issues (excluding feature bug fixes)

14
eval.c
Просмотреть файл

@ -1046,17 +1046,6 @@ rb_mod_prepend(int argc, VALUE *argv, VALUE module)
return module;
}
static void
warn_refinements_once()
{
static int warned = 0;
if (warned)
return;
rb_warn("Refinements are experimental, and the behavior may change in future versions of Ruby!");
warned = 1;
}
static VALUE
hidden_identity_hash_new()
{
@ -1213,7 +1202,6 @@ rb_mod_refine(VALUE module, VALUE klass)
rb_thread_t *th = GET_THREAD();
rb_block_t *block = rb_vm_control_frame_block_ptr(th->cfp);
warn_refinements_once();
if (!block) {
rb_raise(rb_eArgError, "no block given");
}
@ -1265,7 +1253,6 @@ mod_using(VALUE self, VALUE module)
NODE *cref = rb_vm_cref();
rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
warn_refinements_once();
if (prev_frame_func()) {
rb_raise(rb_eRuntimeError,
"Module#using is not permitted in methods");
@ -1405,7 +1392,6 @@ top_using(VALUE self, VALUE module)
NODE *cref = rb_vm_cref();
rb_control_frame_t *prev_cfp = previous_frame(GET_THREAD());
warn_refinements_once();
if (cref->nd_next || (prev_cfp && prev_cfp->me)) {
rb_raise(rb_eRuntimeError,
"main.using is permitted only at toplevel");

Просмотреть файл

@ -395,7 +395,7 @@ class TestRefinement < Test::Unit::TestCase
end
def test_main_using
assert_in_out_err([], <<-INPUT, %w(:C :M), /Refinements are experimental/)
assert_in_out_err([], <<-INPUT, %w(:C :M), [])
class C
def foo
:C
@ -461,7 +461,7 @@ class TestRefinement < Test::Unit::TestCase
end
def test_using_method_cache
assert_in_out_err([], <<-INPUT, %w(:M1 :M2), /Refinements are experimental/)
assert_in_out_err([], <<-INPUT, %w(:M1 :M2), [])
class C
def foo
"original"