Skip to content

Array.prototype.reduceRight() #105

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

lvidacs
Copy link
Contributor

@lvidacs lvidacs commented May 27, 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 May 27, 2015
@galpeter galpeter added this to the ECMA builtins milestone May 27, 2015
// check for init value
try {
[].reduceRight(func);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be an assert(false) after the reduceRight call.

@ILyoan ILyoan mentioned this pull request May 27, 2015
25 tasks
@lvidacs lvidacs force-pushed the array_prototype_reduceright branch from 503d889 to 3a1653e Compare May 29, 2015 13:39
@lvidacs
Copy link
Contributor Author

lvidacs commented May 29, 2015

Updated based on review comments (also from reduce).


JERRY_ASSERT (ecma_is_value_object (arg1));
func_object_p = ecma_get_object_from_value (arg1);
ecma_value_t accumulator = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
Copy link
Contributor

Choose a reason for hiding this comment

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

As I see the accumulator and num_p variables are only used in the following else block, could we move them there?

@lvidacs lvidacs force-pushed the array_prototype_reduceright branch from fc85657 to 0960607 Compare June 1, 2015 15:02
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
@lvidacs lvidacs force-pushed the array_prototype_reduceright branch from 0960607 to 3e58541 Compare June 1, 2015 15:16
@lvidacs
Copy link
Contributor Author

lvidacs commented Jun 1, 2015

The patch is updated.

@galpeter
Copy link
Contributor

galpeter commented Jun 2, 2015

AFAIK: looks good to me

@egavrin
Copy link
Contributor

egavrin commented Jun 2, 2015

make push

@egavrin egavrin self-assigned this Jun 2, 2015
@galpeter
Copy link
Contributor

galpeter commented Jun 3, 2015

rebased & merged: 2a8c928

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.

3 participants