Skip to content
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.substring() #244

Closed

Conversation

lvidacs
Copy link
Contributor

@lvidacs lvidacs commented Jun 26, 2015

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

arg2,
ret_value);

if (ecma_is_completion_value_empty (ret_value))
Copy link
Contributor

Choose a reason for hiding this comment

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

at this point the ret_value is empty, no need for the check

JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
@lvidacs lvidacs force-pushed the string_prototype_substring branch from f965609 to 69a2739 Compare June 26, 2015 13:28
@lvidacs
Copy link
Contributor Author

lvidacs commented Jun 26, 2015

Right, the patch is updated, thanks.

@galpeter galpeter added the ecma builtins Related to ECMA built-in routines label Jun 26, 2015
@galpeter galpeter added this to the ECMA builtins milestone Jun 26, 2015
@ILyoan ILyoan mentioned this pull request Jun 26, 2015
25 tasks
arg2,
ret_value);

if (ecma_number_is_nan (end_num) || ecma_number_is_negative (end_num))
Copy link
Contributor

Choose a reason for hiding this comment

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

This if-else block seems identical with the one above, could we have maybe a helper method for it? Another thing: there is the ecma_builtin_helper_array_index_normalize function which does something like this, could you check if that could be used?

@egavrin egavrin assigned galpeter and lvidacs and unassigned galpeter Jun 30, 2015
/* 1 */
ECMA_TRY_CATCH (check_coercible_val,
ecma_op_check_object_coercible (this_arg),
ret_value);
Copy link
Member

Choose a reason for hiding this comment

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

Is this implicitly changes the this value?

@lvidacs lvidacs force-pushed the string_prototype_substring branch from 69a2739 to 5a32c27 Compare July 2, 2015 16:06
@lvidacs
Copy link
Contributor Author

lvidacs commented Jul 6, 2015

Continued in PR #318

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

Successfully merging this pull request may close these issues.

None yet

3 participants