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

feat: Implement Array.prototype.toString #218

Merged
merged 5 commits into from
Jan 15, 2020
Merged

feat: Implement Array.prototype.toString #218

merged 5 commits into from
Jan 15, 2020

Conversation

cisen
Copy link
Contributor

@cisen cisen commented Jan 12, 2020

I am a rust newbie and my code may not be good. But I will continue to improve this code.

ValueData::String(ref s) => (*s).clone(),
_ => "".to_string(),
},
Err(v) => format!("{}: {}", "error", v.to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for "error" to be a separate param, you can change the template to "error: {}".

Also, no need for .to_string(), v will be formatted accordingly to its value anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice advice

No need for "error" to be a separate param, you can change the template to "error: {}".

Also, no need for .to_string(), v will be formatted accordingly to its value anyway.

nice advice,thank you!

@IovoslavIovchev
Copy link
Contributor

Looks good, sync you branch with master so the pipeline runs, and we are all set

Copy link
Contributor Author

@cisen cisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, sync you branch with master so the pipeline runs, and we are all set

Array.prototype.toString should be passed the tests like jerryscript's。But without enough continuous time,I had to implement a simplified one first。Next,I will improve it.

ValueData::String(ref s) => (*s).clone(),
_ => "".to_string(),
},
Err(v) => format!("{}: {}", "error", v.to_string()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice advice

No need for "error" to be a separate param, you can change the template to "error: {}".

Also, no need for .to_string(), v will be formatted accordingly to its value anyway.

nice advice,thank you!

@IovoslavIovchev IovoslavIovchev merged commit f134a07 into boa-dev:master Jan 15, 2020
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