Skip to content

Implement String.prototype.charAt() #320

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

Closed

Conversation

lvidacs
Copy link
Contributor

@lvidacs lvidacs commented Jul 7, 2015

JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com

@galpeter galpeter added the ecma builtins Related to ECMA built-in routines label Jul 7, 2015
@galpeter galpeter added this to the ECMA builtins milestone Jul 7, 2015
@ILyoan ILyoan mentioned this pull request Jul 7, 2015
25 tasks
@egavrin egavrin added the critical Raises security concerns label Jul 7, 2015

// check undefined
assert("hello world!".charAt(undefined) === "h");

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add test case for boolean arguments also.

@egavrin
Copy link
Contributor

egavrin commented Jul 7, 2015

Good to me.

@lvidacs lvidacs force-pushed the string_prototype_charat branch from 02bf718 to de5d77f Compare July 7, 2015 09:33
@lvidacs
Copy link
Contributor Author

lvidacs commented Jul 7, 2015

Thanks for the review, boolean tests added.

@zherczeg
Copy link
Member

zherczeg commented Jul 7, 2015

LGTM

ecma_string_t *original_string_p = ecma_get_string_from_value (to_string_val);
const ecma_length_t len = ecma_string_get_length (original_string_p);

/* 3 */
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you, please, clarify why step 4 is performed before step 3?

JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
@lvidacs lvidacs force-pushed the string_prototype_charat branch from de5d77f to 59ad6d9 Compare July 7, 2015 13:53
@lvidacs
Copy link
Contributor Author

lvidacs commented Jul 7, 2015

@ruben-ayrapetyan: The order is changed to follow the standard, thanks for the comment.

@egavrin
Copy link
Contributor

egavrin commented Jul 7, 2015

make push

@galpeter
Copy link
Contributor

galpeter commented Jul 8, 2015

Rebased & merged: 632618d

@egavrin
Copy link
Contributor

egavrin commented Jul 8, 2015

@galpeter lets move to branches - since this PR wasn't automatically closed. Again.

@egavrin egavrin closed this Jul 8, 2015
@galpeter
Copy link
Contributor

galpeter commented Jul 8, 2015

@egavrin we could move to branches but not all of us have rights to create branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical Raises security concerns ecma builtins Related to ECMA built-in routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants