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 default parameter for functions #678

Open
buttonfly1000 opened this issue May 21, 2020 · 3 comments · May be fixed by #1481
Open

Support ES2015 default parameter for functions #678

buttonfly1000 opened this issue May 21, 2020 · 3 comments · May be fixed by #1481
Labels
Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec feature Issues considered a new feature
Milestone

Comments

@buttonfly1000
Copy link

Hi.

I found such a js functon

function f(b = 1) {return b;}

would yield an exception:

org.mozilla.javascript.EvaluatorException: missing ) after formal parameters

Would it be possible to support default parameter for functions?

Thanks!

@cbartolome
Copy link

Bootstrap 5 started using default parameters in its JavaScript code, so Selenium tests using the HtmlUnit driver all report the above error now, when using the un-minified code. The minified code produces this error:

com.gargoylesoftware.htmlunit.ScriptException: missing formal parameter (http://localhost:35193/webjars/bootstrap/5.0.1/js/bootstrap.bundle.min.js#6)

@p-bakker p-bakker added this to the ES2015 milestone Jun 29, 2021
@p-bakker p-bakker changed the title Possible to support default parameter for functions? Support ES2015 default parameter for functions 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 p-bakker pinned this issue Jul 2, 2021
@p-bakker p-bakker unpinned this issue Jul 2, 2021
@p-bakker p-bakker pinned 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 feature Issues considered a new feature test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features labels Oct 14, 2021
@p-bakker p-bakker unpinned this issue Mar 3, 2022
@exabrial
Copy link

Bootstrap 5 started using default parameters in its JavaScript code, so Selenium tests using the HtmlUnit driver all report the above error now, when using the un-minified code. The minified code produces this error:

com.gargoylesoftware.htmlunit.ScriptException: missing formal parameter (http://localhost:35193/webjars/bootstrap/5.0.1/js/bootstrap.bundle.min.js#6)

I seem to be getting the same error with bootstrap using the non-minified code. When you tested, what version of bootstrap were you using? I'm hoping they didn't switch to default parameters for the non-min version. Thank you!

@cbartolome
Copy link

That was version 5.0.1 (it's in the error message). Both the un-minified and the minified versions produce errors. They're just slightly different, so I posted the error the minified version produces to make this issue easier to search for.

@p-bakker p-bakker linked a pull request Jul 16, 2024 that will close this issue
@p-bakker p-bakker added Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec and removed test262 harness Issues related to failing test262 tests, due to Rhino not yet support certain JS features labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec feature Issues considered a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants