-
Notifications
You must be signed in to change notification settings - Fork 687
Implement String.prototype.charCodeAt() #352
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
Implement String.prototype.charCodeAt() #352
Conversation
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.
*ret_num_p
|
Good to me |
d251525 to
c19989e
Compare
|
Thanks, the patch is updated. |
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.
No need for the space after the *
c19989e to
ae86c39
Compare
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.
This testcase will not invoke the charCodeAt at all. I think you wanted to write: String.prototype.charCodeAt.call(true)
cb1d234 to
5b7a0c6
Compare
|
LGTM |
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.
While actual length of strings, currently, can't exceed uint32_t range, value of index_num can be bigger. ToInteger is not equivalent to ToUInt32, as ToUInt32 performs "modulo 2^32" operation on its argument, and ToInteger performs floor.
The code would work correctly, as index_num doesn't exceed len, as checked above.
Could you, please, add an assertion that ecma_number_to_uint32 (index_num) == ecma_number_trunc (index_num) and add comment, describing why ToInteger and ToUInt32 are equivalent in the case?
5b7a0c6 to
61a6e93
Compare
|
@ruben-ayrapetyan thanks for the comments, the patch is updated |
|
@lvidacs, thank you for update. |
|
@lvidacs, after fixing #352 (comment) the changes would look good to me |
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
61a6e93 to
c7a47c1
Compare
|
Looks good to me |
|
|
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com