summaryrefslogtreecommitdiff
path: root/lib/prism/polyfill
AgeCommit message (Collapse)Author
6 days[ruby/prism] Fix parser translator during string escaping with invalid utf-8Earlopain
Instead, prefer `scan_byte` over `get_byte` since that already returns the byte as an integer, sidestepping conversion issues. Fixes https://github.com/ruby/prism/issues/3582 https://github.com/ruby/prism/commit/7f3008b2b5
2025-03-19[ruby/prism] Polyfill Kernel#warn category parameterKevin Newton
https://github.com/ruby/prism/commit/d85c72a1b9
2025-03-18[ruby/prism] Fix parser translator crash for certain octal escapesEarlopain
`Integer#chr` performs some validation that we don't want/need. Octal escapes can go above 255, where it will then raise trying to convert. `append_as_bytes` actually allows to pass a number, so we can just skip that call. Although, on older rubies of course we still need to handle this in the polyfill. I don't really like using `pack` but don't know of another way to do so. For the utf-8 escapes, this is not an issue. Invalid utf-8 in these is simply a syntax error. https://github.com/ruby/prism/commit/161c606b1f
2025-03-18[ruby/prism] Fix parser translator when unescaping invalid utf8Earlopain
1. The string starts out as binary 2. `ち` is appended, forcing it back into utf-8 3. Some invalid byte sequences are tried to append > incompatible character encodings: UTF-8 and BINARY (ASCII-8BIT) This makes use of my wish to use `append_as_bytes`. Unfortunatly that method is rather new so it needs a fallback https://github.com/ruby/prism/commit/e31e94a775
2024-05-03[ruby/prism] Prism::Location#adjoinKevin Newton
https://github.com/ruby/prism/commit/a298db68e3
2024-04-25[ruby/prism] Remove need for Natalie patchesKevin Newton
https://github.com/ruby/prism/commit/7fc7e13476
2024-03-06[ruby/prism] Move polyfill to separate file to type-check it independently.Ufuk Kayserilioglu
https://github.com/ruby/prism/commit/2a583b041b