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

minifier: converts optional chaining back for Chrome 88 - 91 #8905

Open
sapphi-red opened this issue Feb 5, 2025 · 0 comments
Open

minifier: converts optional chaining back for Chrome 88 - 91 #8905

sapphi-red opened this issue Feb 5, 2025 · 0 comments
Assignees
Labels
C-bug Category - Bug

Comments

@sapphi-red
Copy link
Contributor

For this input

console.log(opts?.name)

the transformer + minifier outputs

var _opts;console.log((_opts=opts)?.name);

when target is chrome88 (playground).

This probably happens because optional chaining is transpiled into (_opts = opts) === null || _opts === void 0 ? void 0 : _opts.name by the transformer and then minified back into (_opts = opts)?.name.

We check the ES version here, but maybe we need to check whether the specific feature is supported.

if self.target >= ESTarget::ES2020 {

@sapphi-red sapphi-red added the C-bug Category - Bug label Feb 5, 2025
@Boshen Boshen self-assigned this Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

2 participants