summaryrefslogtreecommitdiffhomepage
path: root/mrblib
AgeCommit message (Collapse)Author
2019-05-15Add Enumerator support to `String#each_byte`.Yukihiro "Matz" Matsumoto
`String#each_byte` is not defined in ISO Ruby but it is implemented in the core mruby because it's useful.
2019-05-15Remove `String#=~` and `String#match` that requires `Regexp`.Yukihiro "Matz" Matsumoto
2019-04-27Remove duplicated `String#each_char`KOBAYASHI Shuji
2019-04-21Commented out `String#scan` because it is not implemented yetKOBAYASHI Shuji
2019-04-19Add type check (conversion) in `String#[]=`KOBAYASHI Shuji
Before this patch: 'a'[0] = 1 #=> 1 'a'[:a] = '1' #=> ArgumentError 'a'[:a, 0] = '1' #=> ArgumentError 'a'[0, :a] = '1' #=> ArgumentError 'a'[0, 1] = 1 #=> 1 After this patch / Ruby: 'a'[0] = 1 #=> TypeError 'a'[:a] = '1' #=> TypeError 'a'[:a, 0] = '1' #=> TypeError 'a'[0, :a] = '1' #=> TypeError 'a'[0, 1] = 1 #=> TypeError
2019-04-18Remove duplicated `include Comparable` in `mrblib/string.rb`KOBAYASHI Shuji
2019-04-08Avoid infinite loop when no `Regexp` class is available; fix #4363Yukihiro "Matz" Matsumoto
2019-03-02Raise error on failed comparison in `sort`; ref #4307Yukihiro "Matz" Matsumoto
2019-02-01Move `NONE` to `mrblib/enum.rb`KOBAYASHI Shuji
2019-01-16Avoid runtime evaluation for `MRB_WITHOUT_FLOAT`KOBAYASHI Shuji
2019-01-15Fix coercing for first step counter in `Numeric#step`KOBAYASHI Shuji
Before: a=[]; 7.step(4, -3.0) { |c| a << c }; p a #=> [7, 4.0] After / Ruby: a=[]; 7.step(4, -3.0) { |c| a << c }; p a #=> [7.0, 4.0]
2019-01-04Integrate mrblib/float.rb into src/numeric.cKOBAYASHI Shuji
- Avoid hack for `MRB_WITHOUT_FLOAT` in build scripts - Avoid runtime dispatch for `MRB_WITHOUT_FLOAT`
2019-01-03Remove `Kernel#class_defined?` which is not available in CRuby; #3829Yukihiro "Matz" Matsumoto
2018-11-19Avoid assignments from type checking `String#__to_str`.Yukihiro "Matz" Matsumoto
2018-11-19Removed `to_hash` conversion method.Yukihiro "Matz" Matsumoto
2018-11-19Remove implicit conversion using `to_str` method; fix #3854Yukihiro "Matz" Matsumoto
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-19Remove implicit conversion using `to_int` method.Yukihiro "Matz" Matsumoto
The ISO standard does not include implicit type conversion using `to_int`. This implicit conversion often causes vulnerability. There will be no more attacks like #4120. In addition, we have added internal convenience method `__to_int` which does type check and conversion (from floats).
2018-10-29Rename libmruby stuff to avoid confusiontake-cheeze
2018-10-29Re-implement `Array#_inspect` and `Hash#_inspect` without blocks.Yukihiro "Matz" Matsumoto
To reduce the env object allocation; ref #4143
2018-10-18replace quicksort with mergesort.Tomoyuki Sahara
2018-09-26Implement `Hash#rehash` in C using `sg_compact()`.Yukihiro "Matz" Matsumoto
2018-09-26Add index to larger segment lists for performanceYukihiro "Matz" Matsumoto
2018-09-26Use `mrb_undef_value` for delete mark instead of shifting Hash entry table.Yukihiro "Matz" Matsumoto
That means entry table should be compacted periodically by `sg_compact()`.
2018-09-20Move `Symbol#to_proc` to the core from `mruby-symbol-ext` gem.Yukihiro "Matz" Matsumoto
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-01Fix ISO/JIS section numbers.Yukihiro "Matz" Matsumoto
2018-08-25Remove unused `Hash#__update` method.Yukihiro "Matz" Matsumoto
2018-08-25Make `Array.new` to accept both integers and floats.Yukihiro "Matz" Matsumoto
This time we used `Integral` module which is mruby specific.
2018-08-25Fixed the corner case bug in `String#{gsub!,sub!}`.Yukihiro "Matz" Matsumoto
`"a".sub!("a", "a")` should not return `nil`.
2018-06-04Let inspect recursion do the right thingIchito Nagata
2018-06-01let Hash#merge keep ifnone valueIchito Nagata
2018-04-28Update the patch to not use `funcall` in C; ref #4013Yukihiro "Matz" Matsumoto
2018-04-28Fix Enumerable#hash on non 32-bit integer conf.kimu_shu
2018-04-23sort method should not consume system stack.Tomoyuki Sahara
2018-04-17Implement `Array#__svalue` in C.Yukihiro "Matz" Matsumoto
2018-03-16`__sort_sub__` is a method defined in `Array`; fix #3970Yukihiro "Matz" Matsumoto
Reorganize `__sort_sub__` arguments.
2018-03-16Needed to pass sort block.Yukihiro "Matz" Matsumoto
2017-12-13Should not define `Float` class in `mrblib/00class.rb`; ref #3828Yukihiro "Matz" Matsumoto
Unless it is defined in `numeric.c`.
2017-12-12Modifying frozen objects will raise `FrozenError`.Yukihiro "Matz" Matsumoto
`FrozenError` is a subclass of `RuntimeError` which used to be raised. [Ruby2.5]
2017-11-04Merge branch 'master' of github.com:mruby/mrubyYAMAMOTO Masaya
2017-10-28Use alias to implement `attr` methodYukihiro "Matz" Matsumoto
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-08-26Replaced Array#each with while loop for performance reasonsChristopher Aue
Example benchmark: $ time build/bench/bin/mruby -e "Array.new(2_000_000){ |i| i }.index{ |i| i == 1_999_999 }" Before: real 0m0.934s user 0m0.922s sys 0m0.003s After: real 0m0.590s user 0m0.583s sys 0m0.007s
2017-07-30Improved speed of enumeration methodsChristopher Aue
2017-07-28Fixed return value of Module#include and #prependChristopher Aue
2017-07-25Reimplement sort method to reduce array copying.Yukihiro "Matz" Matsumoto
2017-06-23Make `LocalJumpError` a subclass of `ScriptError`.Yukihiro "Matz" Matsumoto
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-21use `unless` instead of `if not`.Yukihiro "Matz" Matsumoto
2017-03-22Fix result if pattern is emptyksss
2017-03-19Callback should yield with pattern every timeksss
2017-03-19Support to return Enumerator for String#gsub,gsub!ksss