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

Support ES2015 Function Rest Parameters #652

Open
delchev opened this issue Mar 16, 2020 · 2 comments
Open

Support ES2015 Function Rest Parameters #652

delchev opened this issue Mar 16, 2020 · 2 comments
Labels
feature Issues considered a new feature test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features
Milestone

Comments

@delchev
Copy link
Contributor

delchev commented Mar 16, 2020

Hi,

Has anyone already explored how we can support the "rest parameters" in functions?

function sum(...theArgs) {
  return theArgs.reduce((previous, current) => {
    return previous + current;
  });
}

console.log(sum(1, 2, 3));
// expected output: 6

console.log(sum(1, 2, 3, 4));
// expected output: 10

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters

Any guidance will be very much appreciated!

Regards,
Nedelcho

@p-bakker p-bakker changed the title Rest Parameters Support Support ES2015 Function Rest Parameters Jun 29, 2021
@p-bakker p-bakker added this to the ES2015 milestone Jun 29, 2021
@p-bakker p-bakker added the test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features label Jun 29, 2021
@p-bakker

This comment has been minimized.

@p-bakker p-bakker pinned this issue Jul 2, 2021
@p-bakker p-bakker unpinned this issue Jul 2, 2021
@p-bakker p-bakker removed the test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features label Jul 2, 2021
@p-bakker p-bakker added the feature Issues considered a new feature label Oct 14, 2021
@p-bakker
Copy link
Collaborator

Support for ...restParams on (regular, so not arrow) functions has been introduced in #1451 and available in V1.7.15

@p-bakker p-bakker added the test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues considered a new feature test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features
Projects
None yet
Development

No branches or pull requests

2 participants