-
Notifications
You must be signed in to change notification settings - Fork 688
Fix assertion 'bytes_copied > 0 || !string_len' in JSON.stringify() #491
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
Fix assertion 'bytes_copied > 0 || !string_len' in JSON.stringify() #491
Conversation
|
Solution for #406 |
9582c1c to
1419e37
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.
Are you sure this is length not size?
1419e37 to
d08c5ec
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.
Do we really need space_buff?
As I see, we can just call ecma_new_ecma_string_from_utf8 (string_buff, space_buff_size).
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.
hm... You are right, we don't need space_buff.
Updating.
d08c5ec to
fe67b75
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.
To extract a substirng, it is better to use:
context_p.gap_str_p = ecma_string_substr (space_str_p, 0, 10).
Sorry, noticed just now, that this fragment could be simplified so much.
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.
nice! FIxed :)
a83cd9d to
5f296ba
Compare
|
LGTM. |
b79e960 to
4ac18b8
Compare
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
4ac18b8 to
5888401
Compare
Modified some places to support unicode characters.
Also renamed some variables to be more clearer.