Граф коммитов

87157 Коммитов

Автор SHA1 Сообщение Дата
Olle Jonsson b5646124b3 [ruby/timeout] timeout.rb: Update documentation
This is a followup to #49.

https://github.com/ruby/timeout/commit/683fdb45ee
2024-08-28 10:58:23 +00:00
git c1e51abda9 Update bundled gems list as of 2024-08-28 2024-08-28 07:00:25 +00:00
Randy Stauner 942317ebf8
YJIT: Encode doubles to VALUE objects and move stat generation to rust (#11388)
* YJIT: Encode doubles to VALUE objects and move stat generation to rust

Stats that can now be generated from rust have been moved there.

* Move object_shape_count call for runtime_stats to rust

This reduces the ruby method to a single primitive.

* Change hash_aset_usize from macro to function
2024-08-27 22:24:17 -04:00
Takashi Kokubun 5b129c899a
YJIT: Pass method arguments using registers (#11280)
* YJIT: Pass method arguments using registers

* s/at_current_insn/at_compile_target/

* Implement register shuffle
2024-08-27 17:04:43 -07:00
Alan Wu f2ac013009
Add RB_DEFAULT_PARSER preprocessor macro
This way there is one place to change for switching the default.
This also allows for building the same commit with different cppflags.
2024-08-27 23:15:37 +00:00
Alan Wu 1729f47e72 [PRISM] Wait for data before reading pipes and chardevs
With the parse.y parser, when a fifo (named pipe) is passed to
Kernel#load and friends, we wait for data to be available first before
reading. Note that with fifos, opening with `O_RDONLY|O_NONBLOCK` and
then reading will look like EOF with read(2) returning 0, but data can
become available later.

The prism compiler needs to match this behavior to pass
`test_loading_fifo_{fd_leak,threading_raise,threading_success}`. I chose
to use IO#read to do this.

An alternative way to match behavior would be to use open_load_file()
from ruby.c like parse.y, but I opted to only allocate an IO to deal
with threading when reading from pipes and character devices. The
memory mapping code seems to work fine for regular files.
2024-08-27 17:39:34 -04:00
eileencodes 2157dcb568 [ruby/prism] Add `contains_splat` flag
If we have a splat, add a flag for it named `contains_splat`.

https://github.com/ruby/prism/commit/5be97a75c8
2024-08-27 20:53:11 +00:00
eileencodes 7462cc7743 [PRISM] Fix allocations for keyword splat params
Fixes the following allocations tests:

* `test_keyword_and_keyword_splat_parameter`
* `test_keyword_parameter`
* `test_keyword_splat_parameter`
* `test_no_array_allocation_with_splat_and_nonstatic_keywords`
* `test_no_parameters`
* `test_positional_splat_and_keyword_splat_parameter`
* `test_ruby2_keywords`

* Checks for `first_chunk` and if `stack_length == 0` to match the
upstream parser. Otherwise, this optimization is skipped.
* Subtracts the index, otherwise it will skip the hash allocation for
the following: `keyword(*empty_array, a: 2, **empty_hash)`.
* Sets `dup_rest` in order to determine when to set the correct flags
* Doesn't set `VM_CALL_KW_SPLAT_MUT` flag unless `dup_rest` doesn't
match `initial_dup_rest`.

Given the following code:

```ruby
keyword(*empty_array, a: 2)
```

Instructions before:

```
== disasm: #<ISeq:test@test.rb:4 (4,0)-(8,3)>
local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 2] empty_hash@0<Arg>[ 1] empty_array@1
0000 newarray                               0                         (   5)[LiCa]
0002 setlocal_WC_0                          empty_array@1
0004 putself                                                          (   7)[Li]
0005 getlocal_WC_0                          empty_array@1
0007 splatarray                             true
0009 putobject                              :a
0011 putobject                              2
0013 newhash                                2
0015 opt_send_without_block                 <calldata!mid:keyword, argc:2, ARGS_SPLAT|ARGS_SPLAT_MUT|FCALL|KW_SPLAT>
0017 leave                                                            (   8)[Re]
```

Instructions after:

```
== disasm: #<ISeq:test@test.rb:4 (4,0)-(8,3)>
local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 2] empty_hash@0<Arg>[ 1] empty_array@1
0000 newarray                               0                         (   5)[LiCa]
0002 setlocal_WC_0                          empty_array@1
0004 putself                                                          (   7)[Li]
0005 getlocal_WC_0                          empty_array@1
0007 splatarray                             false
0009 putobject                              {:a=>2}
0011 opt_send_without_block                 <calldata!mid:keyword, argc:2, ARGS_SPLAT|FCALL|KW_SPLAT>
0013 leave                                                            (   8)[Re]
```

Differences:

* `splatarray` is `false` not `true
* `putobject`, `putobject`, `newhash` is simply `putobject` with
optimizations on
* Remove `ARGS_SPLAT_MUT` flag

Related: ruby/prism#2994

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-08-27 16:01:46 -04:00
BurdetteLamar 8f700db4ed [DOC] Tweaks for Array#delete_if 2024-08-27 13:01:42 -04:00
Burdette Lamar 0228cf74e3
[DOC] Tweaks for Array#cycle (#11459) 2024-08-27 12:59:31 -04:00
Alexander Momchilov 2fbaff5351 [ruby/prism] Fix warning when `#!` ends with carriage return
https://github.com/ruby/prism/commit/5753fb6260
2024-08-27 16:46:44 +00:00
Alexander Momchilov 83e72fde83 Optimize Array allocations
… by allocating them with the correct capacity.
2024-08-27 16:23:50 +00:00
Jeremy Evans a3562c2a0a
Remove incorrect setting of KW_SPLAT_MUT flag
Fixes [Bug #20701]

Co-authored-by: Pablo Herrero <pablodherrero@gmail.com>
2024-08-27 09:08:22 -07:00
Peter Zhu 2459e79b80 Assume that shared array is not embedded
An array cannot be shared and embedded at the same time, so we can assume
that a shared array is not embedded.
2024-08-27 09:58:38 -04:00
Stan Lo 87fa75c5db [ruby/irb] Move parse_command method to Context
(https://github.com/ruby/irb/pull/993)

Since Context dictates whether a line is a command or an expression,
moving the parse_command method to Context makes the relationship
more explicit.

https://github.com/ruby/irb/commit/9a4487af61
2024-08-27 12:49:23 +00:00
Mari Imaizumi a431f4ecc4 [ruby/reline] Remove unused variables
(https://github.com/ruby/reline/pull/739)

https://github.com/ruby/reline/commit/14784eddee
2024-08-27 12:46:45 +00:00
Hiroshi SHIBATA 04ca75ea69 [ruby/uri] Also warn URI::RFC3986_PARSER.extract
https://github.com/ruby/uri/commit/0f6b945557
2024-08-27 02:39:52 +00:00
dependabot[bot] da9bbd8cd8 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.101 to 0.9.102.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.101...v0.9.102)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/2487c88dfe
2024-08-27 01:19:26 +00:00
yui-knk 52c4d0e048 Remove `enc_coderange_broken` field from `struct rb_parser_config_struct`
It has not been used since fcc55dc226.
2024-08-27 09:59:43 +09:00
Hiroshi SHIBATA e5295644c9 [ruby/fileutils] Update license files same as ruby/ruby
https://github.com/ruby/fileutils/commit/9e32a88573
2024-08-27 00:39:24 +00:00
dependabot[bot] c486fce747 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.101 to 0.9.102.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.101...v0.9.102)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/57afcf60b5
2024-08-26 23:42:19 +00:00
Stan Lo ec61dbd98e [ruby/rdoc] Make darkfish more responsive and readable on mobile
devices
(https://github.com/ruby/rdoc/pull/1162)

- Make the sidebar toggle fixed on all devices
- Prevent default zooming on mobile devices
- Improve sidebar opening on mobile devices

https://github.com/ruby/rdoc/commit/95b6cfb64f
2024-08-26 22:02:33 +00:00
Peter Zhu 8c01dec827 Skip assertion in gc/default.c when multi-Ractor
The counter for total allocated objects may not be accurate when there are
multiple Ractors since it is not atomic so there could be race conditions
when it is incremented.
2024-08-26 13:25:12 -04:00
Peter Zhu 1cafc9d51d Use rb_gc_multi_ractor_p in gc/default.c 2024-08-26 13:25:12 -04:00
BurdetteLamar 51aadefb4d [DOC] Tweaks to Array#delete_at 2024-08-26 13:21:21 -04:00
BurdetteLamar efa4ec0f98 [DOC] Tweaks to Array#delete 2024-08-26 11:20:22 -04:00
Matt Brictson 7c794c287e [rubygems/rubygems] Emit progress to stderr when `--print` is passed to `bundle lock`
`bundle lock --print --update` can take a long time to fetch sources and
resolve the lock file.

Before, `--print` caused output to be completely silenced, so nothing
was printed at all until the resolved lock file is finally emitted to
stdout.

With this change, `--print` now prints progress to stderr. E.g.:

```
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
```

This provides a better user experience, especially when
`lock --print --update` takes several seconds or more.

The lock file is still printed to stdout, so tools consuming the lock
file on stdout will not be affected.

https://github.com/rubygems/rubygems/commit/6719baa700
2024-08-26 14:56:26 +00:00
Matt Brictson 2066482684 [rubygems/rubygems] Fix newline=false being ignored by Shell#warn
https://github.com/rubygems/rubygems/commit/e021ff33a8
2024-08-26 14:56:26 +00:00
Matt Brictson cfad1f95d5 [rubygems/rubygems] Fix missing 'msg' parameter in Shell#no?
https://github.com/rubygems/rubygems/commit/ffe89a099a
2024-08-26 14:56:25 +00:00
Kevin Newton 4ede15fb53 [PRISM] Fix up nested string flags inside string concatenation 2024-08-26 10:49:35 -04:00
Peter Zhu 80d457b4b4 Fix object allocation counters in compaction
When we move an object in compaction, we do not decrement the total_freed_objects
of the original size pool or increment the total_allocated_objects of the
new size pool. This means that when this object dies, it will appear as
if the object was never freed from the original size pool and the new
size pool will have one more free than expected. This means that the new
size pool could appear to have a negative number of live objects.
2024-08-26 09:40:07 -04:00
Peter Zhu c3dc1322ba Move final_slots_count to per size pool 2024-08-26 09:40:07 -04:00
Alexander Momchilov 2b0b68fa46 Shrink `pm_integer_t` (32 bytes → 24) 2024-08-26 12:38:58 +00:00
Hiroshi SHIBATA 03475e5533 bundle install with git repo needs to be run under the git environment 2024-08-26 19:36:04 +09:00
dependabot[bot] 45c04cad40 Bump github/codeql-action from 3.26.4 to 3.26.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.4 to 3.26.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f0f3afee80...2c779ab0d0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26 12:20:07 +09:00
Nobuyoshi Nakada 136cbf0441 [ruby/tempfile] Support anonymous tempfile on earlier than Ruby 3.2
https://github.com/ruby/tempfile/commit/7052805029
2024-08-26 02:49:02 +00:00
yui-knk 2e07c13049 Remove nonexist declarations
These functions were removed by 33c1e082d0.
2024-08-26 09:08:53 +09:00
Burdette Lamar 76e0ea28ea
[DOC] Tweaks to Array#combination (#11440) 2024-08-24 21:22:33 -04:00
Nobuyoshi Nakada 620ce3807b
[Bug #20680] `ensure` block is always void context 2024-08-25 08:16:54 +09:00
Ufuk Kayserilioglu 519152db6d [ruby/rdoc] Make the summary triangle appear in the correct place
when the summary text overflows to next line.
(https://github.com/ruby/rdoc/pull/1160)

https://github.com/ruby/rdoc/commit/f2eb62f6f8
2024-08-24 18:15:21 +00:00
BurdetteLamar fd0263d7ef [DOC] Tweaks for Array#concat 2024-08-24 11:51:28 -04:00
BurdetteLamar bd19d3d163 [DOC] Tweaks for Array#count doc 2024-08-24 11:49:58 -04:00
BurdetteLamar e962c9c4c3 [DOC] Tweaks to Array#compact! 2024-08-24 11:45:01 -04:00
BurdetteLamar 418e85b120 [DOC] Tweaks for Array#compact 2024-08-24 11:44:29 -04:00
Stan Lo 6717b69067 [ruby/rdoc] Modernize RDoc Darkfish template CSS
(https://github.com/ruby/rdoc/pull/1157)

- Update color scheme with muted green tones and improved contrast
- Enhance readability by adjusting font sizes and weights
- Improve code block styling with a light gray background
- Refactor layout for better responsiveness and sidebar presentation
- Standardize link styles across the document
- Implement CSS variables for easier theme customization
- Adjust heading styles for better visual hierarchy
- Enhance table and list styling for improved readability
- Optimize search field and navigation toggle appearance
- Improve method detail and documentation section styling
- Reorganize css and overhaul the sidebar design
- Improve code block's syntax highlighting

https://github.com/ruby/rdoc/commit/6cde9edadb
2024-08-24 11:07:28 +00:00
Peter Zhu 552f5cd50c Fix use-after-free in WeakKeyMap#clear
[Bug #20691]

If the WeakKeyMap has been marked but sweeping hasn't started yet and we
cann WeakKeyMap#clear, then there could be a use-after-free because we do
not call rb_gc_remove_weak to remove the key from the GC.

For example, the following code triggers use-after-free errors in Valgrind:

    map = ObjectSpace::WeakKeyMap.new

    1_000.times do
      1_000.times do
        map[Object.new] = nil
      end

      map.clear
    end

Output from Valgrind:

    ==61230== Invalid read of size 8
    ==61230==    at 0x25CAF8: gc_update_weak_references (default.c:5593)
    ==61230==    by 0x25CAF8: gc_marks_finish (default.c:5641)
    ==61230==    by 0x26031C: gc_marks_continue (default.c:5987)
    ==61230==    by 0x26031C: gc_continue (default.c:2255)
    ==61230==    by 0x2605FC: newobj_cache_miss (default.c:2589)
    ==61230==    by 0x26111F: newobj_alloc (default.c:2622)
    ==61230==    by 0x26111F: rb_gc_impl_new_obj (default.c:2701)
    ==61230==    by 0x26111F: newobj_of (gc.c:890)
    ==61230==    by 0x26111F: rb_wb_protected_newobj_of (gc.c:917)
    ==61230==    by 0x2DE218: rb_class_allocate_instance (object.c:131)
    ==61230==    by 0x2E32A8: class_call_alloc_func (object.c:2141)
    ==61230==    by 0x2E32A8: rb_class_alloc (object.c:2113)
    ==61230==    by 0x2E32A8: rb_class_new_instance_pass_kw (object.c:2172)
    ==61230==    by 0x4296BC: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3788)
    ==61230==    by 0x44A9CD: vm_sendish (vm_insnhelper.c:5955)
    ==61230==    by 0x44A9CD: vm_exec_core (insns.def:898)
    ==61230==    by 0x43A0E4: rb_vm_exec (vm.c:2564)
    ==61230==    by 0x2341B4: rb_ec_exec_node (eval.c:281)
    ==61230==    by 0x236258: ruby_run_node (eval.c:319)
    ==61230==    by 0x15D665: rb_main (main.c:43)
    ==61230==    by 0x15D665: main (main.c:62)
    ==61230==  Address 0x2159cb00 is 0 bytes inside a block of size 8 free'd
    ==61230==    at 0x4849B2C: free (vg_replace_malloc.c:989)
    ==61230==    by 0x248EF1: rb_gc_impl_free (default.c:8512)
    ==61230==    by 0x248EF1: rb_gc_impl_free (default.c:8493)
    ==61230==    by 0x248EF1: ruby_sized_xfree.constprop.0 (gc.c:4178)
    ==61230==    by 0x4627EC: wkmap_free_table_i (weakmap.c:652)
    ==61230==    by 0x3A54AF: apply_functor (st.c:1633)
    ==61230==    by 0x3A54AF: st_general_foreach (st.c:1543)
    ==61230==    by 0x3A54AF: rb_st_foreach (st.c:1640)
    ==61230==    by 0x46203C: wkmap_clear (weakmap.c:973)
    ==61230==    by 0x4296BC: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3788)
    ==61230==    by 0x44A9CD: vm_sendish (vm_insnhelper.c:5955)
    ==61230==    by 0x44A9CD: vm_exec_core (insns.def:898)
    ==61230==    by 0x43A0E4: rb_vm_exec (vm.c:2564)
    ==61230==    by 0x2341B4: rb_ec_exec_node (eval.c:281)
    ==61230==    by 0x236258: ruby_run_node (eval.c:319)
    ==61230==    by 0x15D665: rb_main (main.c:43)
    ==61230==    by 0x15D665: main (main.c:62)
    ==61230==  Block was alloc'd at
    ==61230==    at 0x484680F: malloc (vg_replace_malloc.c:446)
    ==61230==    by 0x25C68E: rb_gc_impl_malloc (default.c:8527)
    ==61230==    by 0x4622E9: wkmap_aset_replace (weakmap.c:817)
    ==61230==    by 0x3A4D02: rb_st_update (st.c:1487)
    ==61230==    by 0x4623E4: wkmap_aset (weakmap.c:854)
    ==61230==    by 0x4296BC: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3788)
    ==61230==    by 0x44A9CD: vm_sendish (vm_insnhelper.c:5955)
    ==61230==    by 0x44A9CD: vm_exec_core (insns.def:898)
    ==61230==    by 0x43A0E4: rb_vm_exec (vm.c:2564)
    ==61230==    by 0x2341B4: rb_ec_exec_node (eval.c:281)
    ==61230==    by 0x236258: ruby_run_node (eval.c:319)
    ==61230==    by 0x15D665: rb_main (main.c:43)
    ==61230==    by 0x15D665: main (main.c:62)
    ==61230==
    ==61230== Invalid write of size 8
    ==61230==    at 0x25CB3B: gc_update_weak_references (default.c:5598)
    ==61230==    by 0x25CB3B: gc_marks_finish (default.c:5641)
    ==61230==    by 0x26031C: gc_marks_continue (default.c:5987)
    ==61230==    by 0x26031C: gc_continue (default.c:2255)
    ==61230==    by 0x2605FC: newobj_cache_miss (default.c:2589)
    ==61230==    by 0x26111F: newobj_alloc (default.c:2622)
    ==61230==    by 0x26111F: rb_gc_impl_new_obj (default.c:2701)
    ==61230==    by 0x26111F: newobj_of (gc.c:890)
    ==61230==    by 0x26111F: rb_wb_protected_newobj_of (gc.c:917)
    ==61230==    by 0x2DE218: rb_class_allocate_instance (object.c:131)
    ==61230==    by 0x2E32A8: class_call_alloc_func (object.c:2141)
    ==61230==    by 0x2E32A8: rb_class_alloc (object.c:2113)
    ==61230==    by 0x2E32A8: rb_class_new_instance_pass_kw (object.c:2172)
    ==61230==    by 0x4296BC: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3788)
    ==61230==    by 0x44A9CD: vm_sendish (vm_insnhelper.c:5955)
    ==61230==    by 0x44A9CD: vm_exec_core (insns.def:898)
    ==61230==    by 0x43A0E4: rb_vm_exec (vm.c:2564)
    ==61230==    by 0x2341B4: rb_ec_exec_node (eval.c:281)
    ==61230==    by 0x236258: ruby_run_node (eval.c:319)
    ==61230==    by 0x15D665: rb_main (main.c:43)
    ==61230==    by 0x15D665: main (main.c:62)
    ==61230==  Address 0x2159cb00 is 0 bytes inside a block of size 8 free'd
    ==61230==    at 0x4849B2C: free (vg_replace_malloc.c:989)
    ==61230==    by 0x248EF1: rb_gc_impl_free (default.c:8512)
    ==61230==    by 0x248EF1: rb_gc_impl_free (default.c:8493)
    ==61230==    by 0x248EF1: ruby_sized_xfree.constprop.0 (gc.c:4178)
    ==61230==    by 0x4627EC: wkmap_free_table_i (weakmap.c:652)
    ==61230==    by 0x3A54AF: apply_functor (st.c:1633)
    ==61230==    by 0x3A54AF: st_general_foreach (st.c:1543)
    ==61230==    by 0x3A54AF: rb_st_foreach (st.c:1640)
    ==61230==    by 0x46203C: wkmap_clear (weakmap.c:973)
    ==61230==    by 0x4296BC: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3788)
    ==61230==    by 0x44A9CD: vm_sendish (vm_insnhelper.c:5955)
    ==61230==    by 0x44A9CD: vm_exec_core (insns.def:898)
    ==61230==    by 0x43A0E4: rb_vm_exec (vm.c:2564)
    ==61230==    by 0x2341B4: rb_ec_exec_node (eval.c:281)
    ==61230==    by 0x236258: ruby_run_node (eval.c:319)
    ==61230==    by 0x15D665: rb_main (main.c:43)
    ==61230==    by 0x15D665: main (main.c:62)
    ==61230==  Block was alloc'd at
    ==61230==    at 0x484680F: malloc (vg_replace_malloc.c:446)
    ==61230==    by 0x25C68E: rb_gc_impl_malloc (default.c:8527)
    ==61230==    by 0x4622E9: wkmap_aset_replace (weakmap.c:817)
    ==61230==    by 0x3A4D02: rb_st_update (st.c:1487)
    ==61230==    by 0x4623E4: wkmap_aset (weakmap.c:854)
    ==61230==    by 0x4296BC: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3788)
    ==61230==    by 0x44A9CD: vm_sendish (vm_insnhelper.c:5955)
    ==61230==    by 0x44A9CD: vm_exec_core (insns.def:898)
    ==61230==    by 0x43A0E4: rb_vm_exec (vm.c:2564)
    ==61230==    by 0x2341B4: rb_ec_exec_node (eval.c:281)
    ==61230==    by 0x236258: ruby_run_node (eval.c:319)
    ==61230==    by 0x15D665: rb_main (main.c:43)
    ==61230==    by 0x15D665: main (main.c:62)

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2024-08-23 16:37:11 -04:00
BurdetteLamar b9902c94a3 Adds remarks about returned Enumerator 2024-08-23 16:21:40 -04:00
Kevin Newton 3eb42054d9 [ruby/prism] Pass Unicode escapes on to onigmo
When we encounter an invalid unicode escape within a regular
expression, we now pass that error on to Onigmo as if it didn't
exist in the parser (which matches the upstream parser's behavior).

We do this because there are tests that specify that you are
allowed to have invalid Unicode escapes if they are within the
context of a regular expression comment for a regular expression
in extended mode. That looks like:

    /# \u /x

Note that this _only_ applies to Unicode escapes (as opposed to
applying to hex or meta/control escapes as well). Importantly it
also only applies if the regular expression is terminated. An
unterminated regular expression will still get error handling done
in the parser. That would look like:

    /# \u

that would result in the same error handling we have today.

https://github.com/ruby/prism/commit/fb98034806
2024-08-23 19:18:14 +00:00
Peter Zhu 3f6be01bfc Make object ID faster by checking flags
We can improve object ID performance by checking the FL_SEEN_OBJ_ID flag
instead of looking up in the table.
2024-08-23 10:49:27 -04:00
Andy Wong b51e1c07d8
[DOC] Fix typos in ObjectSpace::WeakMap docs
The value of variable key2 should be "bar". This way, when nil is assigned to val1 and garbage collection occurs, the output of m.keys will then be ["bar"].
2024-08-23 20:44:51 +09:00