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

Not Respecting ES Version (Chaining) #745

Closed
VastBlast opened this issue Sep 13, 2024 · 0 comments · Fixed by #746
Closed

Not Respecting ES Version (Chaining) #745

VastBlast opened this issue Sep 13, 2024 · 0 comments · Fixed by #746

Comments

@VastBlast
Copy link
Contributor

The minifier does not seem to respect the ECMAScript version when it comes to the Optional Chaining Operator.

It was introduced in ECMAScript 2020, but regardless of the version the minifier always adds to the operator if applicable.

For example, given the following input and setting the ES version to 2016:

const test = {};
const res = test === null || test === void 0 ? void 0 : test.hello;

It returns:

const test={},res=test==null?void 0:test?.hello

As you can see, it uses the chaining operator at test?.hello but it should not. I tested setting different years < 2020 to no avail.

tdewolff added a commit that referenced this issue Sep 14, 2024
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

Successfully merging a pull request may close this issue.

1 participant