Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start work on String#byteindex #2172

Merged
merged 2 commits into from
Jun 30, 2024
Merged

Start work on String#byteindex #2172

merged 2 commits into from
Jun 30, 2024

Conversation

seven1m
Copy link
Member

@seven1m seven1m commented Jun 29, 2024

include/natalie/object.hpp Outdated Show resolved Hide resolved
@seven1m seven1m force-pushed the string-byteindex branch from a8d2145 to a356ed3 Compare June 30, 2024 22:07
seven1m added 2 commits June 30, 2024 17:09
CRuby is inconsistent. Sometimes it raises an error messages like this:

    no implicit conversion from nil to string

...and other times it raises this:

    no implicit conversion of nil into String

The latter is more consistent with other error messages, and I hope that
someday CRuby is self-consistent. For now, though, to make things
spec-compliant, we have:

| method                 | error message style |
|========================|=====================|
| Env::raise_type_error  | old                 |
| Env::raise_type_error2 | new                 |
| Object::to_str         | old                 |
| Object::to_str2        | new                 |
I'll add support for a Regexp argument later.
@seven1m seven1m force-pushed the string-byteindex branch from a356ed3 to 1d19c7d Compare June 30, 2024 22:09
@seven1m seven1m merged commit 2f3aa91 into master Jun 30, 2024
15 checks passed
@seven1m seven1m deleted the string-byteindex branch June 30, 2024 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants