Yukihiro "Matz" Matsumoto
96113a2ed9
mruby-io: define File.absolute_path method; ref #6482
2025-03-08 11:12:12 +09:00
Yukihiro "Matz" Matsumoto
436269f62c
class.c: remove duplicated CI_TARGET_CLASS definition from class.c
2025-03-08 11:09:57 +09:00
Yukihiro "Matz" Matsumoto
3c4f6501b0
class.c (find_visibility_ci): inline find_ci_from_proc()
2025-03-08 07:54:51 +09:00
Yukihiro "Matz" Matsumoto
07b986f710
symbol.c (sym_inline_unpack): should not mix signedness
2025-03-07 17:55:20 +09:00
Yukihiro "Matz" Matsumoto
ec7477fe0d
class.c: take visibility from outer scope
...
It is possible to update the visibility from within a block, so that
`find_visibility_ci()` should look up outer scopes.
2025-03-07 17:49:08 +09:00
Yukihiro "Matz" Matsumoto
67e85ed296
vm.c (mrb_object_exec): update ci's target class by update function
...
To avoid breaking a Proc with env set.
2025-03-07 17:17:50 +09:00
Yukihiro "Matz" Matsumoto
fb56fecf51
class.h: remove macros no longer used
2025-03-07 17:17:50 +09:00
Yukihiro "Matz" Matsumoto
889f09f8b7
class.c: move visibility flags from classes/modules to callinfo
2025-03-07 17:17:50 +09:00
Yukihiro "Matz" Matsumoto
02bf7fe08e
symbol.c (sym_inline_pack): max inline symbol length is now 4
2025-03-07 17:17:50 +09:00
Yukihiro "Matz" Matsumoto
6e1ab49ed3
class.c: allow changing visibility of methods defined in superclasses
2025-03-07 17:17:49 +09:00
Yukihiro "Matz" Matsumoto
2309fa0353
AUTHORS: update entries [ci skip]
2025-03-07 17:17:49 +09:00
Yukihiro "Matz" Matsumoto
37fb59bdac
class.h: rename macros for clarity
...
- MRB_SET_VISIBILITY -> MRB_CLASS_SET_VISIBILITY
- MRB_VISIBILITY -> MRB_CLASS_VISIBILITY
2025-03-07 17:17:49 +09:00
Yukihiro "Matz" Matsumoto
5e6ea6c5f9
vm.c: restore visibility when reopen class/module definition
...
Ideally, the default visibility should be stored in the scope. But for
the time being mruby stores the visibility in the class/module. As a
result, nesting class/module reopening or class_eval/module_eval could
cause incompatibility. We will try to fix them in the future.
2025-03-07 17:17:49 +09:00
Yukihiro "Matz" Matsumoto
2a876d2047
class.c: implement top-level public/private/protected in the core in C
2025-03-07 17:17:49 +09:00
Yukihiro "Matz" Matsumoto
43da490a1e
class.c: alias should keep the visibility of the original
2025-03-07 17:17:48 +09:00
Yukihiro "Matz" Matsumoto
18674c0237
test/module.rb: add visibility tests; ref #1835
2025-03-07 17:17:48 +09:00
Yukihiro "Matz" Matsumoto
384579fd21
test/module.rb: rename to pass the spell check
2025-03-07 17:17:48 +09:00
Yukihiro "Matz" Matsumoto
921d632615
class.c (mrb_mod_visibility): clear method cache
2025-03-07 17:17:48 +09:00
Yukihiro "Matz" Matsumoto
20d5330417
class.c: use MT_VMASK to mask the flag values
2025-03-07 17:17:48 +09:00
Yukihiro "Matz" Matsumoto
3f93254b02
mruby-metaprog: add actual test for Kernel#protected_methods
2025-03-07 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
16db15d6fd
mruby-metaprog: add actual test for Kernel#private_methods
2025-03-07 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
2db1ad9ce3
mruby-metaprog/test: avoid potential name crash by Foo class
2025-03-07 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
6f2409adf3
Revert "proc.h: define visibility flags for RProc"
...
This reverts commit 7948373c7d2a019b0eed6ca6dfcb4d6e503b75d8.
2025-03-07 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
b0db0bdd3a
vm.c: add checks for visibility (private, protected); close #1835
2025-03-07 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
aba9a7d053
class.c: #initialize should be private by default
...
Fixed wrong condition.
2025-03-07 17:17:46 +09:00
Yukihiro "Matz" Matsumoto
1a026ba9aa
pre-commit: autoupdate
2025-03-07 17:17:46 +09:00
Yukihiro "Matz" Matsumoto
29cb270ef4
proc.h: define visibility flags for RProc
...
Visibility status should be store in Procs (that represent scopes), not
classes. Since classes can be reopened or can be accessed recursively.
2025-03-07 17:17:46 +09:00
Yukihiro "Matz" Matsumoto
c22f527bac
symbol.c (SYMBOL_INLINE_P): fix the check condition
...
Symbol `:_` would break the assertion.
2025-03-07 17:17:46 +09:00
Yukihiro "Matz" Matsumoto
6a61cd9373
kernel.c: make #respond_to_missing? private
2025-03-07 17:17:46 +09:00
Yukihiro "Matz" Matsumoto
52403abcf8
mruby-binding: make Kernel#binding private
2025-03-07 17:17:45 +09:00
Yukihiro "Matz" Matsumoto
e5e8dd11c0
mruby-rational: make Rational() private
2025-03-07 17:17:45 +09:00
Yukihiro "Matz" Matsumoto
2a991fb399
mruby-complex: make Complex() private
2025-03-07 17:17:45 +09:00
Yukihiro "Matz" Matsumoto
111fe4b3be
mruby-compiler: generate OP_SSEND from Complex and Rational literals
2025-03-07 17:17:45 +09:00
Yukihiro "Matz" Matsumoto
4a0e80601f
mruby-kernel-ext: make Kernel methods private
...
- fail
- caller
= __method__
- __callee__
- Integer
= Float
- String
- Array
- Hash
2025-03-07 17:17:45 +09:00
Yukihiro "Matz" Matsumoto
93e133548f
mruby-eval: make #eval private
2025-03-07 17:17:44 +09:00
Yukihiro "Matz" Matsumoto
d7a4275dd1
mruby-metaprog: make #global_variables, #local_variables private
2025-03-07 17:17:44 +09:00
Yukihiro "Matz" Matsumoto
95b30a38dc
kernel.rb: make Kernel#loop private
2025-03-07 17:17:44 +09:00
Yukihiro "Matz" Matsumoto
ff6149dea7
kernel.c: removed some Kernel singleton methods
...
Since virtually no one calls `Kernel.block_given?` but just
`block_given?`. For the cases `raise` is redefined (like Ruby/Tk),
`Kernel.raise` is kept.
2025-03-07 17:17:44 +09:00
Yukihiro "Matz" Matsumoto
3a56106d6c
mruby-proc-ext: make #proc private
2025-03-07 17:17:43 +09:00
Yukihiro "Matz" Matsumoto
efc03f60af
proc.c: make #lambda private
2025-03-07 17:17:43 +09:00
Yukihiro "Matz" Matsumoto
cc54865873
mruby-sleep: make #sleep (and #usleep) private
2025-03-07 17:17:43 +09:00
Yukihiro "Matz" Matsumoto
f7142cd327
mruby-random: make Kernel#srand and #rand private
2025-03-07 17:17:43 +09:00
Yukihiro "Matz" Matsumoto
4f5cad6444
mruby-catch: make #catch and #throw private
2025-03-07 17:17:43 +09:00
Yukihiro "Matz" Matsumoto
6bb629e957
mruby-exit: make exit methods private
2025-03-07 17:17:42 +09:00
Yukihiro "Matz" Matsumoto
6f97c842d2
mruby-io: use ... for argument forwarding
2025-03-07 17:17:42 +09:00
Yukihiro "Matz" Matsumoto
a736ddcbb7
mruby-io: make some methods private
...
- open
- print
- printf
- gets
2025-03-07 17:17:42 +09:00
Yukihiro "Matz" Matsumoto
37d3d34036
mruby-compiler: use OP_SSEND for backquote calls
2025-03-07 17:17:42 +09:00
Yukihiro "Matz" Matsumoto
cfc104e66c
class.c (mrb_define_module_function): make instance method private
2025-03-07 17:17:42 +09:00
Yukihiro "Matz" Matsumoto
d022a3ee68
mruby-eval/test: use #__send__ to call private #eval
2025-03-07 17:17:41 +09:00
Yukihiro "Matz" Matsumoto
23d5e04fdf
mruby-proc-ext/test: fix wrong usage of mrb_module_function()
2025-03-07 17:17:41 +09:00