-
Notifications
You must be signed in to change notification settings - Fork 683
Make parseInt unicode tolerant #467
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
Conversation
{ | ||
if ((utf8_string_buff[i]) >= LIT_CHAR_LOWERCASE_A && utf8_string_buff[i] <= LIT_CHAR_LOWERCASE_Z) | ||
ecma_char_t current_char = lit_utf8_iterator_read_next (&iter); | ||
ecma_number_t current_number; |
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.
I think we should use an integer type here instead of an ecma_number_t
.
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.
good point, will fix it in the update.
LGTM |
{ | ||
start++; | ||
start = lit_utf8_iterator_get_pos (&iter); | ||
current = lit_utf8_iterator_read_next (&iter); |
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.
Shouldn't we check for eos
before doing this?
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.
Yeah, good catch!
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
b7dddd1
to
b5e4dc5
Compare
PR updated. |
{ | ||
start += 2; | ||
ecma_char_t next = lit_utf8_iterator_peek_next (&iter); |
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.
There should probably be an eos
check here as well.
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.
In this case it is not needed, as the offset check in the if
statement above already checked that there are at least two characters, so we are not at the end of the string yet.
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.
Ah, okay.
lgtm |
LGTM. |
|
Landed: 3fbe543 |
Fixes #405
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com