-
Notifications
You must be signed in to change notification settings - Fork 71
String/replaceall #428
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
String/replaceall #428
Conversation
aapoalas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some optimisations that can be made but looks absolutely good to me aside from a correctness standpoint. Let's make those changes and get this merged!
Thank you and great work! <3
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
|
Thanks for the comments (every PR to nova is a masterclass of Rust for me). I hope it's okay now! |
load1n9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
aapoalas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'll merge this a bit later in case you want to make any changes based on my nitpicks.
|
@aapoalas thanks! Don't merge it yet. I'll make the changes, just need a bit more time (I'm busy right now) |
Ah, alright! Don't worry about it <3 |
Hi again 👋
In this PR I've implemented the
String.prototype.replaceAllfunction.During the implementation I've discovered some bugs in
String.prototype.replacethat are also fixed, specifically:replacefunction works likereplaceAllin javascript (replacing all occurrences). I've changed toreplacen(search, replace, 1)to replace only the first occurence.search.find(subject)instead ofsubject.find(search)).