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

[JS] Support for nullish assignment / class and more ES6 rules #380

Closed
RickoNoNo3 opened this issue Feb 18, 2021 · 3 comments
Closed

[JS] Support for nullish assignment / class and more ES6 rules #380

RickoNoNo3 opened this issue Feb 18, 2021 · 3 comments

Comments

@RickoNoNo3
Copy link

RickoNoNo3 commented Feb 18, 2021

Issue

Minify minified a special javascript code file. Then it returned a 0 byte response. After some testings, I found the problem:

With this style, Minify runs well:

args = args ?? [];

With this style, Minify goes wrong:

args ??= [];

more information on the nullish assignment: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_nullish_assignment

Version

2.9.13

@RickoNoNo3 RickoNoNo3 changed the title [JS] Support for nullish assignment [JS] Support for nullish assignment / class and more ES6 rules Feb 18, 2021
@RickoNoNo3
Copy link
Author

This kind of javascript can not be parsed too:

class A {
  prop = 1;
  constructor() {
    // some code
  };
  method = () => {
    // some code
  };
};

The minifier can't process this kind of class format.

@tdewolff
Copy link
Owner

Both syntax types are not in the specification but still in the proposal stage. I've added the first as you requested, let me see how much is involved in the class one.

@tdewolff
Copy link
Owner

tdewolff commented Mar 1, 2021

It's supported now, however it's still in the proposal phase. Usually the minifiers follow the latest official specification, but this is an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment