Feature #15547 ยป 0001-Deprecate-iterator-method.patch
| spec/ruby/core/kernel/iterator_spec.rb | ||
|---|---|---|
|
require_relative '../../spec_helper'
|
||
|
require_relative 'fixtures/classes'
|
||
|
describe "Kernel#iterator?" do
|
||
|
it "is a private method" do
|
||
|
Kernel.should have_private_instance_method(:iterator?)
|
||
|
ruby_version_is ""..."2.7" do
|
||
|
describe "Kernel#iterator?" do
|
||
|
it "is a private method" do
|
||
|
Kernel.should have_private_instance_method(:iterator?)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
describe "Kernel.iterator?" do
|
||
|
it "needs to be reviewed for spec completeness"
|
||
|
describe "Kernel.iterator?" do
|
||
|
it "needs to be reviewed for spec completeness"
|
||
|
end
|
||
|
end
|
||
| vm_eval.c | ||
|---|---|---|
|
/*
|
||
|
* call-seq:
|
||
|
* block_given? -> true or false
|
||
|
* iterator? -> true or false
|
||
|
*
|
||
|
* Returns <code>true</code> if <code>yield</code> would execute a
|
||
|
* block in the current context. The <code>iterator?</code> form
|
||
| ... | ... | |
|
* try do "hello" end #=> "hello"
|
||
|
*/
|
||
|
static VALUE
|
||
|
rb_f_block_given_p(void)
|
||
|
{
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
/*
|
||
|
* call-seq:
|
||
|
* iterator? -> true or false
|
||
|
*
|
||
|
* Deprecated. Use block_given? instead.
|
||
|
*/
|
||
|
static VALUE
|
||
|
rb_f_iterator_p(void)
|
||
|
{
|
||
|
rb_warning("iterator? is deprecated; use block_given? instead");
|
||
|
return rb_f_block_given_p();
|
||
|
}
|
||
|
VALUE
|
||
|
rb_current_realfilepath(void)
|
||
|
{
|
||
| ... | ... | |
|
{
|
||
|
rb_define_global_function("eval", rb_f_eval, -1);
|
||
|
rb_define_global_function("local_variables", rb_f_local_variables, 0);
|
||
|
rb_define_global_function("iterator?", rb_f_block_given_p, 0);
|
||
|
rb_define_global_function("iterator?", rb_f_iterator_p, 0);
|
||
|
rb_define_global_function("block_given?", rb_f_block_given_p, 0);
|
||
|
rb_define_global_function("catch", rb_f_catch, -1);
|
||