summaryrefslogtreecommitdiffhomepage
path: root/src/class.c
AgeCommit message (Collapse)Author
2016-12-12should not try to set classpath for frozen classes; ref #3340Yukihiro "Matz" Matsumoto
2016-12-12freeze classes/modules; ref #3340Yukihiro "Matz" Matsumoto
2016-12-04Add symbol type check for Module#undef_methodYukihiro "Matz" Matsumoto
2016-11-30Prohibit instantiation of immediate objectsYukihiro "Matz" Matsumoto
2016-11-24Fix segfault on remove_method with invalid argumentBouke van der Bijl
Reported by https://hackerone.com/jpenalbae
2016-11-17renamed "inline" to "istruct" to represent inline struct; ref #3251Yukihiro "Matz" Matsumoto
2016-11-17inline structures data type for mruby (MRB_TT_INLINE) (fix #3237)Tomasz Dąbrowski
Inline structures have no instance variables, no finalizer, and offer as much space as possible in RBASIC object. This means 24 bytes on 64-bit platforms and 12 bytes on 32-bit platforms. mruby-inline-struct gem is only provided for testing.
2016-11-16Correct argument specifications for few methods:Tomasz Dąbrowski
- Struct#values_at - Module#define_method - String#chop - String#chop!
2016-11-15class/module statement should re-open; fix #3225Yukihiro "Matz" Matsumoto
2016-11-13move mrb_str_dup() to mrb_class_path; ref #2470Yukihiro "Matz" Matsumoto
Class#to_s used to return same string repeatedly, that mean you can modify "class name" by modifying the return value from Class#to_s.
2016-11-11Merge pull request #3224 from ksss/define_methodYukihiro "Matz" Matsumoto
Module#define_method supports proc argument
2016-11-10Renamed class_under_defined to class_defined_underFelix Jones
2016-11-06Added mrb_class_under_definedFelix Jones
2016-10-12Module#define_method supports proc argumentksss
2016-08-20Move Module#include and #prepend to class.c; ref #3197Yukihiro "Matz" Matsumoto
To avoid VM nesting with mrb_funcall()
2016-02-24Avoid Error when Compiling with -std=c99 flagMalizia R
2016-01-22Fix SEGV by stack extension in mrb_get_args()Kouhei Sutou
mrb_get_args() keeps pointer of the current stack. But address of the current stack maybe changed by method call. 'i' format character calls #to_i when the argument isn't integer but has #to_i. Here is a code that may call #to_i in mrb_get_args(): case 'i': // ... default: *p = mrb_fixnum(mrb_Integer(mrb, ARGV[arg_i])); break; // ... Here is a code #to_i is called: class X def initialize(i) @i = i end def to_i @i end end [][X.new(0), 0] # X#to_i is called So, mrb_get_args() shouldn't keep pointer and use it. mrb_get_args() should always refer mrb->ci->stack to use valid address of the current stack.
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-10-28mrb_get_args should consume argument even when type specifier with bang get ↵Yukihiro "Matz" Matsumoto
nil; fix #3002
2015-09-05remove `origin` member to implement prepend from struct RClass; ref #2885Yukihiro "Matz" Matsumoto
instead origin is saved in ICLASS with MRB_FLAG_IS_ORIGIN set.
2015-09-04Merge branch 'module-prepend' of https://github.com/polyfox/mruby into ↵Yukihiro "Matz" Matsumoto
polyfox-module-prepend
2015-07-16Make include_module_at staticCorey Powell
Since I can't forsee any reason to use it directly inplace of using prepend/include
2015-07-16use mrb_str_cat_str() instead of mrb_str_append()cremno
If the argument is always a string, then mrb_str_cat_str() can be directly called instead of indirectly by mrb_str_append(). mrb_any_to_s(), mrb_obj_as_string(), mrb_inspect() always return a string.
2015-07-14Remove non-applicable "hack" commentCorey Powell
2015-07-14Applied gc patch to fix ORIGIN ICLASS method table leakCorey Powell
Based on the gc patch by ko1 https://github.com/ruby/ruby/commit/5922c954614e5947a548780bb3b894626affe6dd
2015-07-14Renamed parameters in include_module_atCorey Powell
2015-07-14mrb_get_args: improve function description about !Yukihiro "Matz" Matsumoto
2015-07-14mrb_get_args: allow d!Yukihiro "Matz" Matsumoto
2015-07-14mrb_get_args: allow A,H,s,z,a,d specifiers to take ! to accept nil.Yukihiro "Matz" Matsumoto
S,A,H gives nil, s,z,a,d gives NULL for nil argument. ref 02474da
2015-07-13included_modules, origin fixCorey Powell
Prepended modules would include their origin ICLASS
2015-07-13Bugfix, included_modules would include classesCorey Powell
2015-07-13Removed comment beside method_removedCorey Powell
Not sure if this apart of the ISO standard, so make sure its not misrepresented
2015-07-13Added Module#method_removed hookCorey Powell
2015-07-13Fixed Modules not being fully initialized before #initialize was calledCorey Powell
2015-07-13Added changed check to the mrb_include_moduleCorey Powell
2015-07-13Remove some remnant debug codeCorey Powell
2015-07-13Additional patches to make this workCorey Powell
2015-07-13Comment in a refactor to match MRI, but that fails 320 tests.Blaž Hrastnik
2015-07-13origin must be initializedBlaž Hrastnik
2015-07-13Expose insert position, which should be at origin for include and klass forBlaž Hrastnik
prepend.
2015-07-13Implement Module#prepend.Blaž Hrastnik
2015-07-13allow '!' after 'S' specifier of mrb_get_args() that allow nil.Yukihiro "Matz" Matsumoto
thus "S!" means String|nil type. you have to check nil before dereferencing the value. this is added to address #2882 while keeping code simplicity. besides that current #2882 fix lose polymorphism provided by mrb_get_args().
2015-07-13refactor mrb_bob_missing to share raising NoMethodError code; fix #2878Yukihiro "Matz" Matsumoto
Note: arguments of mrb_no_method_error() has changed. You need to replace 3rd and 4th argument (say n, argv) to mrb_ary_new_from_values(mrb, n, argv).
2015-06-24Remove unnecessary backticks.Franck Verrot
Dr Markus Kuhn published in 1999 an article [1] explaining in details why we shouldn't use the ASCII grave accent (0x60) as a left quotation. Backticks have been used most notably to produce nice-looking LaTeX documents but it doesn't seem to be an issue on modern platforms and for the oldest ones, there are workarounds as mentioned by Dr Kuhn. [1]: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
2015-06-22Fixes #912Jared Breeden
2015-05-29check if outer is a class or modulecremno
For modules this check didn't exist yet. Also call #inspect.
2015-05-28remove unnecessary including of <ctype.h>cremno
Not needed anymore since 85075bef7583edd0a48cfbdfaa632cbdacf78f2c
2015-05-15remove mrb_define_method_vm() functioncremno
It isn't needed as it's very similar to mrb_define_method_raw() and also there's only one place where mrb_proc_ptr() actually has to be called. Inspired by @furunkel's method cache patch (#2764).
2014-12-12Fix crash if #inspect does not return a string valuesdottaka
case 1 ~~~ class A; def inspect; 1; end; end A.new.a ~~~ case 2 ~~~ class A def self.inspect 1 end alias_method :a, :b end ~~~
2014-11-19separate mrb_notimplement() and mrb_notimplement_m(); ref #2636Yukihiro "Matz" Matsumoto