Commit Graph

16636 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 4d547b6cbb test/module.rb: call #remove_const via #__send__ to skip private check 2025-03-07 17:17:40 +09:00
Yukihiro "Matz" Matsumoto e0cb99aad4 test/module.rb: call #extend_object via #__send__ to skip private check 2025-03-07 17:17:40 +09:00
Yukihiro "Matz" Matsumoto 8a409feaad test/module.rb: call #prepend_features via #__send__ to skip private check 2025-03-07 17:17:40 +09:00
Yukihiro "Matz" Matsumoto 701a18deda test/module.rb: call #append_features via #__send__ to skip private check 2025-03-07 17:17:40 +09:00
Yukihiro "Matz" Matsumoto 7653bdd05e test/codegen.rb: call #remove_const via #__send__ to skip private check 2025-03-07 17:17:39 +09:00
Yukihiro "Matz" Matsumoto f82cd188b0 test/exception.rb: call #initialize via #__send__ to skip private check 2025-03-07 17:17:39 +09:00
Yukihiro "Matz" Matsumoto 214ae5aad3 test/array.rb: call #initialize via #__send__ to skip private check 2025-03-07 17:17:39 +09:00
Yukihiro "Matz" Matsumoto 7981865e18 test/string.rb: call #initialize via #__send__ to skip private check 2025-03-07 17:17:39 +09:00
Yukihiro "Matz" Matsumoto 4122cee9e4 class.c: implement attr_accessor in C 2025-03-07 17:17:39 +09:00
Yukihiro "Matz" Matsumoto 27828de749 kernel.c: make some methods private
- block_given?
- initialize_copy
- iterator?
- p
- print
- raise
- respond_to_missing?
2025-03-07 17:17:38 +09:00
Yukihiro "Matz" Matsumoto bfcc1e3c2c mruby-io: puts should print nothing for empty arrays 2025-03-07 17:17:38 +09:00
Yukihiro "Matz" Matsumoto 7d2beb9fef class.c (mrb_remove_method): should call hook method from the origin
MRB_CLASS_ORIGIN moves the pointer for prepended class/module, but the
hook method should be searched from the original class/module.
2025-03-07 17:17:38 +09:00
Yukihiro "Matz" Matsumoto 6168b15e0e class.c (undef_method): call hook method when undef'ing a method 2025-03-07 17:17:38 +09:00
Yukihiro "Matz" Matsumoto bcd0e0e439 class.c (mrb_remove_method): call hook method
Depending the context, hook method should be either method_removed or
singleton_method_removed.
2025-03-07 17:17:38 +09:00
Yukihiro "Matz" Matsumoto 457aaa173b mruby-metaprog (mrb_mod_remove_method): stop calling method_removed()
The hook method should be called from mrb_remove_method().
2025-03-07 17:17:37 +09:00
Yukihiro "Matz" Matsumoto 0863c08841 class.c: implement singleton method hook methods
- singleton_method_removed
- singleton_method_undefined
2025-03-07 17:17:37 +09:00
Yukihiro "Matz" Matsumoto 9c74f6e908 class.c: implement method hook methods
- method_removed
- method_undefined
2025-03-07 17:17:37 +09:00
Yukihiro "Matz" Matsumoto eb8b4120d7 class.c: initialize method needs to be private by default 2025-03-07 17:17:37 +09:00
Yukihiro "Matz" Matsumoto 4ea5510937 mruby-compiler (merge_op_string): fix #6477
If two merging strings are the same and registered at the bottom of the
pool, we should not remove the slot from the pool.
2025-03-07 17:17:37 +09:00
Yukihiro "Matz" Matsumoto e660e28a39 class.c: make some Module methods private
- append_features
- extend_object
- extended
- included
- initialize
- method_added
- module_function
- prepend_features
- prepended
- private
- protected
- public
- remove_const
2025-03-07 17:17:36 +09:00
Yukihiro "Matz" Matsumoto f5150ab98a class.c: make some Class methods private
- initialize
- inherited
2025-03-07 17:17:36 +09:00
Yukihiro "Matz" Matsumoto c5e270e8f3 class.c: make some BasicObject methods private
- initialize
- singleton_method_added
- method_missing
2025-03-07 17:17:36 +09:00
Yukihiro "Matz" Matsumoto ca20017ac9 class.c: implement mrb_define_private_method() 2025-03-07 17:17:36 +09:00
Yukihiro "Matz" Matsumoto 71c0de7f08 class.c (mrb_define_method_raw): take visibility from the class
If not explicitly specified in the method struct.
2025-03-07 17:17:36 +09:00
Yukihiro "Matz" Matsumoto 1ab8e4d27d mruby-toplevel-ext: make Main#include private 2025-03-07 17:17:35 +09:00
Yukihiro "Matz" Matsumoto 7f12e6648f AUTHORS: update entries [ci skip] 2025-03-07 17:17:35 +09:00
Yukihiro "Matz" Matsumoto 1e4a3f3e5c mruby-toplevel-ext: implement toplevel public/private/protected 2025-03-07 17:17:35 +09:00
Yukihiro "Matz" Matsumoto 235c1484d0 mruby-toplevel-ext: Directly include features to Object class 2025-03-07 17:17:35 +09:00
Yukihiro "Matz" Matsumoto 9e3e7b2cfe mruby-metaprog: add 3 new methods to retrieve instance method names
- public_instance_methods
- private_instance_methods
- protected_instance_methods
2025-03-07 17:17:34 +09:00
Yukihiro "Matz" Matsumoto 9229da10e4 mruby-metaprog: implement method list from a class (or an instance) 2025-03-07 17:17:34 +09:00
Yukihiro "Matz" Matsumoto a282f8bf2a mruby-metaprog: remove unnecessary enum 2025-03-07 17:17:34 +09:00
Yukihiro "Matz" Matsumoto fdf71d8f2d class.c: first step to private methods; #1835
Now each method entry holds visibility information in flag bits.
2025-03-07 17:17:34 +09:00
Yukihiro "Matz" Matsumoto 3a3e877ae5 codedump.c: update OP_DEF output
OP_DEF takes R(a) as a class to define a method, sym(b) as a method
name, and R(a+1) as a method body. So we added `(R(a+1))` in the output.
2025-03-07 17:17:34 +09:00
Yukihiro "Matz" Matsumoto 6442a012c8 symbol.c (SYMBOL_INLINE_P): inline symbol to occupy 26 bits in mrb_sym
It used to occupy 30 bits, but we need 2 more bits to keep method
visibility in the method tables.
2025-03-07 17:17:33 +09:00
Yukihiro "Matz" Matsumoto 3e6abfd21c symbol.c (sym_inline_pack): set pack_length_max to 4 2025-03-07 17:17:33 +09:00
Yukihiro "Matz" Matsumoto fc16f9dd13 Merge pull request #6482 from dearblue/absolute_path
Add `File.absolute_path?` method
2025-03-07 17:16:20 +09:00
dearblue c796729fa8 Add File.absolute_path? method 2025-03-05 22:23:49 +09:00
Yukihiro "Matz" Matsumoto 8f69fbbaf8 Merge pull request #6480 from mruby/dependabot/github_actions/super-linter/super-linter-7.3.0 2025-02-28 12:24:20 +09:00
dependabot[bot] 1d76e9f4f4 build(deps): bump super-linter/super-linter from 7.2.1 to 7.3.0
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 7.2.1 to 7.3.0.
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/v7.2.1...v7.3.0)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-27 14:28:50 +00:00
Yukihiro "Matz" Matsumoto 0e1a77e7d7 Merge pull request #6479 from dearblue/expand_path 2025-02-27 10:36:32 +09:00
Yukihiro "Matz" Matsumoto 30b0b41fb1 Merge pull request #6478 from dearblue/chars2bytes 2025-02-27 10:32:55 +09:00
dearblue f77ebfe102 Reimplementation of File.expand_path method
The reason for this is to fix the following problems

  - Even on non-Windows, drive letter recognition was still being handled.
  - On Windows, paths starting with a slash were not expanded correctly.
  - On Windows, relative paths containing drive letters behaved differently than in CRuby.

Due to reimplementation, the internal methods `File._concat_path`, `File._gethome` and `File._getwd` methods have been removed.
2025-02-26 21:55:25 +09:00
dearblue 437065997f Redefine some macros in mruby-io
To improve uniformity of names and definition locations.
2025-02-26 21:55:17 +09:00
dearblue 76fc6e9ace Fixed buffer overrun in function chars2bytes()
If `off` was greater than zero, the address pointed to by `e` exceeded the valid range of the buffer.
2025-02-26 21:22:37 +09:00
Yukihiro "Matz" Matsumoto 66606f71dd Merge pull request #6474 from dearblue/kwerr 2025-02-03 11:54:52 +09:00
Yukihiro "Matz" Matsumoto 623e953193 Merge pull request #6473 from dearblue/bigint 2025-02-03 08:28:54 +09:00
Yukihiro "Matz" Matsumoto 8c1915ec3b Merge pull request #6475 from dearblue/buildconf 2025-02-02 21:24:32 +09:00
dearblue d946c3e264 Don't include deleted mruby-print 2025-02-02 21:13:11 +09:00
dearblue b86c220384 Avoid array object creation with “unknown keyword” error
It is sufficient to return the first element.
2025-02-02 21:02:03 +09:00
dearblue 3b1e3d930f Hide mpz_and() symbol 2025-02-02 16:59:28 +09:00