aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
Commit message (Collapse)AuthorAgeFilesLines
* * object.c (Init_Object): Add reference to BasicObject, briefdrbrain2011-10-101-7/+18
| | | | | | | | | explanation of constant lookup. Based on patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-6/+6
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_clone): singleton class should be attachednobu2011-09-181-1/+6
| | | | | | | singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:44460]. [Bug #5274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Add usage documentation for BasicObject. Based on patchdrbrain2011-07-271-0/+47
| | | | | | | by Thomas Sawyer. [Ruby 1.9 - Bug #5067] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (rb_print_undef_str): new function to raisenobu2011-07-261-1/+19
| | | | | | | | | | | NameError for undefined method. * load.c (rb_mod_autoload_p), object.c (rb_mod_const_get), variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c (rb_mod_{remove,undef,alias}_method, set_method_visibility): remove inadvertent symbol creation. based on the first patch by Jeremy Evans at [ruby-core:38447]. [Feature #5089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_check_id): make the given name a symbol or a string.nobu2011-07-261-5/+5
| | | | | | based on the second patch by Jeremy Evans at [ruby-core:38447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_name_error_str): new function to raise NameErrornobu2011-07-231-6/+43
| | | | | | | | with the name string but not ID. * object.c, proc.c, variable.c: more removal of inadvertent symbol creation. [Feature #5079] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):nobu2011-07-221-3/+6
| | | | | | | | | | | | avoid inadvertent symbol creation in reflection methods. based on a patch by Jeremy Evans at [ruby-core:38367]. [Feature #5072] * vm_method.c (rb_mod_method_defined) (rb_mod_{public,private,protected}_method_defined) (obj_respond_to): ditto. * parse.y (rb_check_id): new function returns already interned ID or 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * math.c: Attach documentation for Math.drbrain2011-06-291-0/+9
| | | | | | | | | | | | | | | | | | | | * object.c: Document NIL, TRUE, FALSE. * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR. Document ARGF global constant. * lib/rake: Hide deprecated toplevel constants from RDoc (import from rake trunk). * lib/thwait.rb: Document ThWait. * lib/mathn.rb: Hide Math redefinition from RDoc * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync, Synchronizer. * parse.y: Document SCRIPT_LINES__. * hash.c: Document ENV class and global constant. * vm.c: Document TOPLEVEL_BINDING. * version.c: Document RUBY_* constants. * ruby.c: Document DATA and ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): Teach RDoc what Init_class_hierarchy does todrbrain2011-06-271-13/+22
| | | | | | | hook up ri for BasicObject, Object, Module and Class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, internal.h iseq.h: declare internal functions.akr2011-06-181-5/+0
| | | | | | | | | | | | | | | | | | * compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/backward/classext.h: for evil gems. fixed #4803nobu2011-06-181-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Document Module#method_added and #method_removed.drbrain2011-06-171-0/+48
| | | | | | | Patch by Bryce Kerley. [Ruby 1.9 - Feature #4867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_attr_accessor, rb_mod_const_set): made rdocmarcandre2011-05-271-8/+13
| | | | | | more precise by specifying Object can searched for Modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: add for internal use only.nobu2011-05-181-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: format comments to keep 80 columns in a line.nagachika2011-05-121-6/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_equal): Add documentation. Patch by Vincent Batts.drbrain2011-05-111-4/+13
| | | | | | | | | | [Ruby 1.9 - Bug #4664] * lib/rexml: ditto * lib/mkmf.rb: ditto * ext/socket/lib/socket.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_String): Kernel#String should call to_str before to_s.nagachika2011-03-291-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_str_to_dbl): rewrite again. use ALLOCV insteadkosaki2011-01-271-7/+4
| | | | | | | | rb_str_tmp_new(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_str_to_dbl): Fix again. use rb_str_tmp_new()kosaki2011-01-241-4/+7
| | | | | | | | instead ALLOC_N. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_str_to_dbl): use ALLOC_N instead ALLOCA_N becausekosaki2011-01-241-3/+7
| | | | | | | | ALLOC_N may cause stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Make BasicObject.new accept no parameter.marcandre2010-10-301-3/+3
| | | | | | Revert of r26135 [ruby-core:27080], as per [ruby-core:32952]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object), constant.h, variable.cmame2010-10-261-0/+2
| | | | | | | | | | (rb_mod_private_constant, rb_mod_public_constant, set_const_visibility, rb_const_get_0): add Module#public_constant and private_constant. [ruby-dev:39685][ruby-core:32698] * test/ruby/test_module.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, constant.h, gc.c, method.h, object.c, variable.c,mame2010-10-261-1/+2
| | | | | | | | | | | | vm_insnhelper.c: use struct rb_constant_entry_t as entry of RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant directly. Now instead rb_const_entry_t is contained in RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and have not only the value itself but also visibility flag. This is another preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c, gc.c, object.c, variable.c, vm_insnhelper.c,mame2010-10-261-0/+4
| | | | | | | | | | include/ruby/ruby.h: separate RCLASS_CONST_TBL from RCLASS_IV_TBL. RCLASS_IV_TBL has contained not only instance variable table but also constant table. Now the two table are separated to RCLASS_CONST_TBL and RCLASS_IV_TBL. This is a preparation for private constant (see [ruby-dev:39685][ruby-core:32698]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-12/+4
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-4/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-12/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improved doco for both Module.new and Class.newryan2010-09-181-3/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_class): remove mention of obsolete method.usa2010-08-271-3/+1
| | | | | | | a patch from Run Paint Run Run at [ruby-core:31842]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add rdoc about Kernel#<=> [ruby-core:31770]naruse2010-08-201-1/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_f_integer): add example with base.nobu2010-07-061-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: Object#public_methods, private_methods, etc. returnsmame2010-06-171-103/+4
| | | | | | | | | | | | method ids that belong to the class or the singleton class(es) of the object. [ruby-dev:41613] * class.c: on the other hand, Module#public_instance_methods, etc. returns method ids that belong to the module itself (even if the module is singleton, it does not return method ids of super class(es); see [ruby-core:28837]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed trailing spaces.nobu2010-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c : use simple lazy sweep algorithm for response performancenari2010-05-281-1/+1
| | | | | | | | | | | | | | gain. See [ruby-dev:41067]. * object.c: FL_MARK of some objects by lazy sweep is copied when RVALUE is cloned. These objects are not marked in the mark phase. So delete FL_MARK. * class.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/lib/openssl/x509-internal.rb, lib/forwardable.rb,nobu2010-05-231-1/+1
| | | | | | | | | lib/irb/cmd/fork.rb, lib/mutex_m.rb, lib/shell/process-controller.rb, lib/sync.rb, object.c: suppress warnings patched by Benoit Daloze at [ruby-core:30366]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-75/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): return 0.0 if hexadecimal andnaruse2010-04-011-0/+10
| | | | | | | | | baccheck is FALSE: Float("0x1p+0") works, but "0x1p+0".to_f doesn't. [ruby-dev:40650] * util.c (ruby_strtod): allow hexdecimal integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enable Object#inspect doc.akr2010-03-231-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_singleton_class): new methodshugo2010-03-231-0/+24
| | | | | | Kernel#singleton_class. [ruby-core:21702] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_hash): use LONG2FIX to avoid Bignum allocation.akr2010-03-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_clone): call initialize_clone hook method tomatz2010-02-081-2/+16
| | | | | | | | | | | | | | | | call initialize_copy. * object.c (rb_obj_dup): call initialize_dup hook. * lib/delegate.rb (Delegator#initialize_clone): use new hook to implement deep copy. [ruby-dev:40242] * lib/delegate.rb (Delegator#initialize_dup): ditto. * test/test_delegate.rb (TestDelegateClass#test_copy_frozen): add a test to ensure #clone copies frozen status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_initialize): Make sure BasicObject doesn't get ↵marcandre2010-01-131-1/+1
| | | | | | | | initialized twice [ruby-core:27577] * class.c (rb_class_init_copy): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/object.c (rb_obj_cmp): Default <=> operator returns 0 if objects are ↵marcandre2009-12-241-1/+1
| | | | | | == [ruby-core:24063] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: BasicObject#initialize accepts any number of arguments ↵marcandre2009-12-201-1/+9
| | | | | | [ruby-core:27080] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (convert_type): Cleanup unused variablemarcandre2009-11-011-5/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz2009-10-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to_ary. Just call. [ruby-core:23738] * eval.c (rb_check_funcall): new function with method existence check. returns Qundef when the method does not exist. * enumerator.c (enumerator_rewind): just call method, using rb_check_funcall(). [ruby-core:23738] * error.c (exc_equal): ditto. * object.c (convert_type): ditto. * error.c (rb_name_err_mesg_new): export function. * eval.c (make_exception): ditto. * io.c (pop_last_hash): return early when the last argument is nil. * io.c (rb_io_puts): treat T_STRING specially for small optimization. * vm_eval.c (raise_method_missing): skip method call if possible using rb_method_basic_definition_p(). * vm_eval.c (method_missing): ditto. * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_debug): test suites changed to ignore exceptions caused by just-call policy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_cmp): defines Object#<=>. [ruby-core:24063]matz2009-10-241-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e