806 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto ff08856fe3 Remove implicit conversion using to_str method; fix #3854
We have added internal convenience method `__to_str` which
does string type check.

The issue #3854 was fixed but fundamental flaw of lack of stack
depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA`
for workaround.
2018-11-19 12:05:46 +09:00
Yukihiro "Matz" Matsumoto d47003aea4 Fixed a bug in argument number check with kwargs; fix #4159 2018-11-05 07:44:25 +09:00
Tomoyuki Sahara 91444c4747 replace quicksort with mergesort. 2018-10-18 13:07:47 +09:00
Yukihiro "Matz" Matsumoto 82e00ce60f Hash#delete should return the deleted value; fix #4133 2018-10-12 08:25:54 +09:00
Yukihiro "Matz" Matsumoto 3a9caad8eb Move Symbol#to_proc to the core from mruby-symbol-ext gem.
Even though `Symbol#to_proc` is not included in ISO standard, the
`some_method(&:method_name)` is used very widely and convenient.
So we moved it to the core.
2018-09-20 13:47:29 +09:00
dearblue 366848996a Clear terminated space 2018-09-07 22:32:34 +09:00
Yukihiro "Matz" Matsumoto ade7185a2b Merge pull request #4055 from take-cheeze/verbose_bintest
Support verbose mode in bintest.
2018-09-05 07:11:23 +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
Kazuhiro Sera 2b2ff844a1 Fix misspelling words in comments 2018-08-25 09:19:17 +09:00
Yukihiro "Matz" Matsumoto 889f0f5f36 Add test case corresponding to 53e2723. 2018-07-31 17:27:59 +09:00
Yukihiro "Matz" Matsumoto 8c9e712784 Keyword argument implemented. 2018-07-30 22:58:01 +09:00
take-cheeze acd04ad519 Support verbose mode in bintest. 2018-06-21 11:33:34 +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
Takeshi Watanabe e66c990234 Fix array replace leak error in mruby-uri. 2018-04-25 13:27:00 +09:00
Takeshi Watanabe 77a3863a3d Return nil if type differ in String#<=>. 2018-03-24 16:18:44 +09:00
Yukihiro "Matz" Matsumoto 1d55260423 String#inspect to use hexadecimal, not octal to print unprintable. 2018-02-12 22:56:24 +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 e14387440e Skip test/t/float.rb tests; ref #3827 2017-12-13 08:45:46 +09:00
bamchoh 81dc383291 Use same format between Fail and Skip
We can see gem name in skip message by this fix
2017-12-09 02:12:37 +09:00
Yukihiro "Matz" Matsumoto 597149ae23 Change newline style of test/t/lang.rb (from DOS) 2017-11-22 16:10:28 +09:00
Yukihiro "Matz" Matsumoto b4f9b031de Some cosmetic changes 2017-11-22 16:09:50 +09:00
YAMAMOTO Masaya 625f9f6fa3 Merge branch 'master' of github.com:mruby/mruby 2017-11-04 01:23:12 +09:00
Yukihiro "Matz" Matsumoto 5405b47f41 Update test for Kernel#local_variables 2017-10-28 00:29:30 +09:00
YAMAMOTO Masaya dcd5d0ffec Test for MRB_WITHOUT_FLOAT 2017-10-11 17:58:11 +09:00
Christopher Aue 35deaae776 Tested LocalJumpErrors caused by break in a proc 2017-08-30 12:25:55 +02:00
Christopher Aue bf32265743 Allowed to pass multiple exceptions to assert_raise 2017-08-30 11:03:51 +02:00
Christopher Aue 4b0b8f7e1a Refactored #assert_raise and #assert_nothing_raised 2017-08-29 23:25:53 +02:00
Christopher Aue 3366894a40 Fixed register windows of OP_SENDs generated by NODE_{DREGX,REGX}; ref #3783 2017-08-23 18:16:05 +02:00
Christopher Aue 499498a6a7 Tested register windows of OP_SENDs generated by NODE_{DXSTR,XSTR}; ref #3783 2017-08-23 18:15:54 +02:00
Christopher Aue 84d8ecc1d7 Fixed register windows of OP_SENDs generated by NODE_OP_ASGN; ref #3783 2017-08-23 18:15:44 +02:00
Christopher Aue 1221f7676e Fixed register windows of OP_SENDs generated by NODE_{FOR,SYMBOLS}; ref #3783 2017-08-23 18:15:27 +02:00
Christopher Aue c040c8d92b Tested register windows of OP_SENDs generated by NODE_{RESCUE,HASH,ALIAS}; ref #3783 2017-08-23 18:15:08 +02:00
Christopher Aue c6596cf26a Fixed register windows of OP_SENDs generated by NODE_{SCALL,CASE,YIELD,UNDEF}; ref #3783 2017-08-23 18:12:35 +02: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 9e10afe1d0 Implements `Module::nesting' (15.2.2.3.2); ref #600, #3200 2017-08-01 15:37:21 +09:00
Yukihiro "Matz" Matsumoto b290e98f3b Merge pull request #3757 from christopheraue/module_const_get_class_path
Extended Module#const_get to support class paths
2017-07-29 07:05:37 +09:00
Christopher Aue f937af5745 Extended Module#const_get to support class paths 2017-07-28 23:19:49 +02:00
Christopher Aue b499ad6749 Fixed return value of Module#include and #prepend 2017-07-28 17:38:40 +02:00
Christopher Aue 468cc34c93 Fixed Module#to_s and #name for #const_set modules 2017-07-18 22:55:37 +02:00
Christopher Aue 8fe2a6ce0f added basic tests for while/until/break/next 2017-07-16 22:25:48 +02:00
Christopher Aue 495a2e605d fixed printing failed assertions 2017-07-11 12:53:48 +02:00
ksss bf48473cf6 Should only check frozen for Array#pop 2017-07-09 18:05:21 +09:00
ksss c76dc33116 Add frozen test for Array#shift 2017-07-09 17:53:12 +09:00
Yukihiro "Matz" Matsumoto c6bd8ceab7 Merge pull request #3726 from mruby/stable
mruby-1.3.0
2017-07-04 15:46:38 +09:00
Hiroshi Mimaki ba1cd56ffa Fixed an unit test to work on Cygwin. 2017-07-03 16:01:01 +09:00
Yukihiro "Matz" Matsumoto 466a18b0d3 Remove redundant use of Object#to_s in interpolation. 2017-06-28 23:28:24 +09:00
Yukihiro "Matz" Matsumoto b30eba6a13 Make LocalJumpError a subclass of ScriptError.
It's incompatible with CRuby, but it is required for mruby because
it cannot detect `break` outside of loops in the parsing time, but
in the code generation time where it cannot raise `SyntaxError`.
2017-06-23 18:08:38 +09:00
Yukihiro "Matz" Matsumoto af0bef6dd8 Silence rubocop warnings. 2017-06-22 00:27:17 +09:00
Yukihiro "Matz" Matsumoto 057be5ffb5 use unless instead of if not. 2017-06-21 11:13:33 +09:00