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

Const usage added which adds new consumption requirements and breaks tests #5989

Closed
bbaraban opened this issue Apr 5, 2022 · 4 comments
Closed

Comments

@bbaraban
Copy link

bbaraban commented Apr 5, 2022

Describe the bug
The following usage of const is causing issues with testing that use PhantomJS with the lastest release of moment.
const word = translator.correctGrammaticalCase(number, wordKey);
I see unexpected token 'const' in the console logs when the test are executing.

Was const meant to be added? With this being added it adds new requirements for consuming moments, (maybe some type of polyfilling?) that wasn't there before for a minor version bump.

Can const be removed so that moment remain passive for its current consumers?

@juanpablowg
Copy link

We have the same issue. Recently we updated moment.js from 2.29.1 to 2.29.2 and our jasmine unit/integration tests launched from Chutzpath using PhantomJS have stopped working.
We review changes between versions and the problem is the sentences:

const word = translator$1.correctGrammaticalCase(number, wordKey);
const word = translator$2.correctGrammaticalCase(number, wordKey);

This sentences use ECMAScript 6 not supported in PhantomJS
https://stackoverflow.com/questions/48699385/does-phantomjs-supports-constantconst-and-let

Will would be possible change it for backward compatibility, using "var" instead of "const"? In other way we have must follow using previous moment. js version 2.29.1

@SebastianBock83
Copy link

Same issue here with these lines in DOJO build job.
Please provide a fix, otherwise we are forced to use the old vulnerable version of moment.

@theboolean
Copy link
Contributor

Hi guys, I already opened a PR to fix this problem: #5995

@ichernev
Copy link
Contributor

Fixed in 2.29.3, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants