-
Notifications
You must be signed in to change notification settings - Fork 687
Implement String.prototype.trim() #191
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
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.
new_len + 1
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.
Add tests for trim, please.
Like from here:
var orig = ' foo ';
console.log(orig.trim());
var orig = 'foo ';
console.log(orig.trim()); // 'foo'fa5b9a5 to
722faf8
Compare
|
Thanks for the review, the patch is updated and tests are added. |
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.
AFAIK: we usually use the jrt-libc-include.h and not directly the ctype.h/other libc headers.
eddb47c to
c4c0437
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.
No need for this check as inside the ECMA_TRY_CATCH the ret_value is an empty value.
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
c4c0437 to
2c93ffd
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.
len - postfix - 1
|
Good to me after fixing. |
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
2c93ffd to
58f49ca
Compare
|
Thanks for the reviews, the patch is updated. |
|
if @galpeter is OK, |
|
looks better, lgtm |
|
Rebased & squased & merged: caa1617 |
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com