60 Commits

Author SHA1 Message Date
dearblue 366848996a Clear terminated space 2018-09-07 22:32:34 +09:00
Yukihiro "Matz" Matsumoto b80e0ef742 Move Kernel#send to mruby-metaprog gem.
But `BasicObject#__send__` is still available from the core.
2018-09-01 11:20:30 +09:00
Yukihiro "Matz" Matsumoto e471d37ca5 Separate meta-programming features to mruby-metaprog gem.
We assume meta-programming is less used in embedded environments.
We have moved following methods:

 * Kernel module
   global_variables, local_variables, singleton_class,
   instance_variables, instance_variables_defined?, instance_variable_get,
   instance_variable_set, methods, private_methods, public_methods,
   protected_methods, singleton_methods, define_singleton_methods

 * Module class
   class_variables, class_variables_defined?, class_variable_get,
   class_variable_set, remove_class_variable, included_modules,
   instance_methods, remove_method, method_removed, constants

 * Module class methods
   constants, nesting

Note:
Following meta-programming methods are kept in the core:

 * Module class
   alias_method, undef_method, ancestors, const_defined?, const_get,
   const_set, remove_const, method_defined?, define_method

 * Toplevel object
   define_method

`mruby-metaprog` gem is linked by default (specified in default.gembox).
When it is removed, it will save 40KB (stripped:8KB) on x86-64
environment last time I measured.
2018-08-30 22:30:36 +09:00
Yukihiro "Matz" Matsumoto f408143c28 The clone method should copy object status (e.g. frozen) too; #4030 2018-06-01 22:39:40 +09:00
Yukihiro "Matz" Matsumoto 2a5545cc25 Update Kernel#method_missing tests for new NoMethodError message.
Also removed tests that depends on implementation details of the default
`method_missing` behavior.
2017-12-23 15:18:13 +09:00
Yukihiro "Matz" Matsumoto 5405b47f41 Update test for Kernel#local_variables 2017-10-28 00:29:30 +09:00
Christopher Aue 731dd78aa0 Added basic test for calling a missing method through super 2017-08-11 14:09:22 +02:00
Yukihiro "Matz" Matsumoto 466a18b0d3 Remove redundant use of Object#to_s in interpolation. 2017-06-28 23:28:24 +09:00
ksss bd72dba8c0 Kernel#local_variables: Make result array unique 2017-02-06 11:16:47 +09:00
ksss 5c1c002ac2 Fix segv when primitive value
Fix #3352
2016-12-25 16:52:10 +09:00
Takashi Kokubun 10bb7ad693 Implement Object#freeze 2016-12-11 03:44:15 +09:00
Bouke van der Bijl 9c61e1cd87 Use mrb_ptr instead of mrb_cptr in Kernel#to_s
This is to avoid segfault when WORD_BOXING is enabled

Reported by https://hackerone.com/brakhane
2016-12-01 15:23:56 -05:00
Bouke van der Bijl 73bb30c2f4 Copy over INSTANCE_TT when duping class 2016-11-24 09:52:30 -05:00
Yasuhiro Matsumoto 8a15ab0c0c add test for public_methods(false) 2016-06-18 01:21:21 +09:00
Yukihiro "Matz" Matsumoto 35d4137da1 remove part of 9cd71916 test for same reason as 5306e47 2014-06-01 02:51:04 +09:00
take_cheeze d8d07a2345 Move Kernel.local_variables to core. 2014-05-19 22:05:02 +09:00
Carson McDonald aa2e03cdf6 Add test for remove_instance_variable 2014-05-18 15:53:11 -04:00
take_cheeze 49cf477688 Fix #2259 . 2014-05-16 19:58:36 +09:00
take_cheeze d0c0beb880 Move __method__ to mruby-kernel-ext since it's not ISO method. 2014-05-09 22:44:10 +09:00
ksss f0dd4cb673 Implement Kernel#define_singleton_method 2014-03-28 18:16:28 +09:00
ksss 65ace4e027 Implement Kernel#__method__ 2014-03-27 18:25:47 +09:00
Jun Hiroe caa139f91a Refactor tests in kernel.rb 2014-02-27 23:49:58 +09:00
cubicdaiya 677cd22be1 add test for Kernel#instance_variable_defined? 2014-02-26 22:44:22 +09:00
Pavel 411168deab Fix Kernel#global_variables for $1-$9 2014-02-09 23:54:49 +07:00
Tomoyuki Sahara 83413218a5 add operator "!~". 2014-01-10 13:41:41 +09:00
Yukihiro "Matz" Matsumoto d40a62e2d2 object_id may not return Fixnum (ISO says Integer), since intptr_t may be bigger than Fixnum, so type check for Numeric; ref #1630 2014-01-04 21:12:18 +09:00
Yukihiro "Matz" Matsumoto e8dd8180ba return value from #object_id may not be Fixnum; ref #1630 2014-01-01 12:24:20 +09:00
Yukihiro "Matz" Matsumoto 047f318cf9 successful recursion check to be shallower; ref #1630 2014-01-01 12:20:48 +09:00
Carson McDonald 60cd1c341b Method missing and inspect tests 2013-12-31 14:53:44 -05:00
Carson McDonald 9cd7191622 Test coverage of extending stack and overflow 2013-12-31 14:49:24 -05:00
Carson McDonald 3911a052a6 More object_id test coverage 2013-12-31 14:47:17 -05:00
Carson McDonald 12e2488a4a Add is_a? test to cover issue 1477 2013-12-04 10:29:40 -05:00
Jun Hiroe b423171eb4 I fix order of actual and expect test value in kernel.rb. 2013-08-02 21:04:02 +09:00
Daniel Bovensiepen 4bd527cebf Improve Kernel Tests 2013-06-15 01:32:22 +08:00
Carson McDonald 61c0b8f7df Adding a few more respond_to tests 2013-05-05 09:14:41 -04:00
Carson McDonald 54e1ed20f9 Add a test for respond_to_missing? 2013-04-20 07:47:58 -04:00
Masaki Muranaka 91db290412 Add a comment. Kernel#require is defined in the mrbgem. 2013-04-06 18:24:42 +09:00
Masaki Muranaka d1b131e2b0 Add some tests. 2013-04-06 18:22:42 +09:00
Masaki Muranaka 4bb7243c2b Add comments: some methods is defined in mrbgems. 2013-04-02 11:43:35 +09:00
Masaki Muranaka c9e19913cf Add comments: eval method is defined in mrbgems. 2013-04-02 11:43:35 +09:00
Kouki Ooyatsu 7e163c0567 bugfix: Kernel#!=, and add #!= testcase. 2013-04-01 12:18:19 +09:00
Beoran 8949e3c7fb Bugfix for crash if main was extended with a module. 2012-10-09 21:45:41 +02:00
Daniel Bovensiepen e44c3fc8aa Don't check ObjectID of Kernel#to_s. Only class check of instance 2012-09-15 14:14:25 +09:00
Daniel Bovensiepen 5b96b41b8a Add Kernel Tests 2012-09-09 15:28:01 +08:00
Yukihiro Matsumoto fd3af6aec8 introduce toplevel object main; close #327 2012-09-03 00:41:09 +09:00
Yukihiro Matsumoto 119b9f5bd5 check value from NilClass#inspect 2012-08-12 04:20:53 +09:00
Yukihiro Matsumoto a2a4563eaf check inside of result from Kernel#instance_variable 2012-08-12 04:19:17 +09:00
Yukihiro "Matz" Matsumoto 8eca0d5609 Merge pull request #378 from masamitsu-murase/modify_proc_lambda
Modify proc_lambda
2012-07-17 16:25:36 -07:00
Masamitsu MURASE e6f1e7b899 Add tests for Kernel#lambda and Kernel.lambda. 2012-07-18 02:25:34 +09:00
Masamitsu MURASE 6f2aefae1f Add test for 'respond_to?'. 2012-07-18 02:23:16 +09:00