-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat(ecmascript): String.prototype.split()
#417
Conversation
@aapoalas I think it's ready to review. btw, what is the recommended way to test the function? I'd like to have a file to execute (like |
|
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
Oh, oops. I only now realized this is actually your first PR here! Sorry, I wasn't paying attention and thought you were behind #416 as well! Welcome, and great work getting yourself up from the ground with the borrow checker! And sorry about the nitpicking on the spec text: It's just a good idea to stick fairly close to it. I don't mean it personally <3 |
Thanks for your review @aapoalas I'm learning the codebase of the repo, how to implement and test things, and now I just learned that the numbers in the comments corresponds to the steps in the ecma262 specs. I'll continue working on this. |
I'm sorry! This is definitely my failing! I should add some more about this to the CONTRIBUTING.md and maybe elsewhere as well so that new contributors have an easier way in. |
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
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
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
Thanks for all your help @aapoalas , I'm learning a lot There're still much work to do yet. There are some cases that are not explained in the spec but they are failing in the tests. For example, when the |
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.
Found a bunch to comment on, but nothing terribly out of whack. Thank you very much, and welcome again to Nova!
Absolutely feel free to keep on trying to solve any remaining cases: The eval-test
command is very useful for testing individual test262 case. eg.
cargo build && cargo run --bin test262 eval-test built-ins/String/prototype/split/argument-is-new-reg-exp-and-instance-is-string-hello.js
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
Show resolved
Hide resolved
nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_prototype.rs
Outdated
Show resolved
Hide resolved
@aapoalas I have fixed a lot of tests due a stupid bug: I was getting the limit argument with I've also applied your suggestions. The only unresolved comment is the one related with UTF-16. |
Sorry, it's taking me some time to get to re-reviewing this. I've been buried under an avalanche of grapes during the last few days. |
String.prototype.split()
No problem! I saw the pictures and completely understand your priorities! 🍇 |
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.
Minor nitpicks / thoughts / questions.
But looks good to me! Thank you for this, great work!
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
Thank you again and great work! <3 |
Please, bear with me. I'm learning Rust and I don't have much experience with the borrow checker.