16706 Commits

Author SHA1 Message Date
mimaki a2841fd9a8 Update version to 3.4.0RC. 3.4.0-rc 2025-03-10 14:42:59 +09:00
Yukihiro "Matz" Matsumoto f4de205960 range.c (range_num_to_a): reduce integer to float conversion
For big numbers (especially integers close to MRB_INT_MAX), float
conversion may be lose precisions. So we try not to convert numbers, but
just compare.
2025-03-10 13:13:10 +09:00
Yukihiro "Matz" Matsumoto 76d3739a89 mruby-metaprog (mrb_obj_methods): should not retrieve obj->c directly
In some cases, `obj` may not be an object structure, but an immediate.
2025-03-10 11:40:48 +09:00
Yukihiro "Matz" Matsumoto c618b44fee class.c (include_module_at): narrow local variable scope 2025-03-10 11:26:13 +09:00
Yukihiro "Matz" Matsumoto 48f93adcdc class.c (boot_defclass): unify variable declaration and initialization 2025-03-10 11:25:34 +09:00
Yukihiro "Matz" Matsumoto 32200f1eb9 build_config/no-float.rb: test build for MRB_NO_FLOAT
mruby allows to disable floating point numbers. We have add a build
configuration to test mruby build without floating point numbers.
2025-03-09 17:14:46 +09:00
Yukihiro "Matz" Matsumoto f2c8b43d42 mruby-test: stop unused local variable warning 2025-03-09 16:43:28 +09:00
Yukihiro "Matz" Matsumoto 4ba0cac481 numeric.c (coerce_step_counter): move local variable definition
To avoid unused local variable warning.
2025-03-09 16:42:28 +09:00
Yukihiro "Matz" Matsumoto 2b76967724 Merge pull request #6487 from esotericpig/master
Add Emscripten toolchain & build_config
2025-03-09 14:28:30 +09:00
Yukihiro "Matz" Matsumoto 9a226c28bc hash.c: add arity check for Hash#default_proc (and Hash.new); fix #6484 2025-03-08 16:14:26 +09:00
Yukihiro "Matz" Matsumoto a7f3cfb711 hash.c: allow 'default_proc=nil' to clear default_proc; ref #6483 2025-03-08 15:49:26 +09:00
Yukihiro "Matz" Matsumoto 837f62f18a hash.c: should check type before setting default_proc; fix #6483 2025-03-08 12:34:25 +09:00
Yukihiro "Matz" Matsumoto fbaedfeaad test/hash.rb: remove Hash#freeze before Hash#rehash; ref #6485 2025-03-08 11:25:49 +09:00
Yukihiro "Matz" Matsumoto 87680d3ab2 hash.c (mrb_hash_rehash): call hash_modify before actual modify; fix #6485 2025-03-08 11:21:27 +09:00
Yukihiro "Matz" Matsumoto 213a262b20 hash.c (mrb_hash_compact): call hash_modify instead of mrb_check_frozen
Currently, hash_modify() only calls mrb_check_frozen, but we may add new
checks in the future; ref #6485
2025-03-08 11:15:37 +09:00
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
esotericpig bfc9742848 Add Emscripten toolchain & build_config 2025-03-07 12:39:54 -10: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