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

Unit testing for Array and String #63

Merged
merged 12 commits into from
Jul 11, 2019
Merged

Unit testing for Array and String #63

merged 12 commits into from
Jul 11, 2019

Conversation

oovm
Copy link
Contributor

@oovm oovm commented Jul 8, 2019

  • Passed:

  • Array.prototype.join()

  • Array.prototype.concat()

  • String.prototype.repeat()

  • Need fix:

  • String.prototype.length

  • String.prototype.concat()

@oovm
Copy link
Contributor Author

oovm commented Jul 8, 2019

Bug: @jasonwilliams

const s = new String('\ud834\udf06');
console.log(s.length)

Should be 2 but return 4.

@oovm
Copy link
Contributor Author

oovm commented Jul 8, 2019

TODO:

  • Format Array display form.

I don't know how to do this.

@oovm
Copy link
Contributor Author

oovm commented Jul 8, 2019

Bug(known):

const hello = "Hello, ";
hello.concat("world!")

waiting for auto box.

@oovm oovm marked this pull request as ready for review July 9, 2019 06:23
@oovm
Copy link
Contributor Author

oovm commented Jul 9, 2019

Please review: @jasonwilliams

  1. May conflict with Refactor objects #69 , I use a step by step vm in unit testing.

  2. CI build failed because of The command "cargo clippy --verbose" exited with 101.

It is caused by the code in #56, I can't modify it.

  1. I tried to fix String.prototype.length, but this problem is a bit complicated.

this_str.len() counts UTF8 length, I changed as this_str.chars().count() to count unicode surrogate pair length.

But js string length is UTF16/USC2 length, still different on some special cases.

src/lib/js/string.rs Outdated Show resolved Hide resolved
@jasonwilliams
Copy link
Member

@GalAster you looking for me to merge this or you wanting to carry on?

@oovm
Copy link
Contributor Author

oovm commented Jul 10, 2019

@jasonwilliams It's ready to merge, I'll do the rest after Array format complete.

@jasonwilliams jasonwilliams merged commit 9110254 into boa-dev:master Jul 11, 2019
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