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

Minified JS broken with private class identifiers #393

Closed
PLUS-RobertEhrenleitner opened this issue Nov 24, 2022 · 4 comments
Closed

Minified JS broken with private class identifiers #393

PLUS-RobertEhrenleitner opened this issue Nov 24, 2022 · 4 comments

Comments

@PLUS-RobertEhrenleitner

When a class contains private attributes or methods, the necessary line break or semicolon is not inserted.
As a minimum non-working example, the following class in valid JavaScript syntax does not work:

class TestClass {
    #a = 3
    #b = 5
    #fnc1() {
        do_something()
    }
    #fnc(2) {
        do_anything()
    }
}

It is minified to:

class TestClass{#a=3#b=5#fnc1(){do_something()}#fnc(2){do_anything()}}

which contains several syntax errors: There should be line breaks or semicolons between all the attributes and methods.

@futtta
Copy link
Owner

futtta commented Nov 24, 2022

Autoptimize uses Mr Clay's JS minify for the minification @PLUS-RobertEhrenleitner, it might make more sense to report it there. When solved there I can make sure the upstream update is "inherited" by AO as well.

@PLUS-RobertEhrenleitner
Copy link
Author

Thank you for this fast response, I reissued it there.

@PLUS-RobertEhrenleitner
Copy link
Author

This issue is fixed by the commit which updates JSMin including my fix.

@futtta
Copy link
Owner

futtta commented Dec 14, 2022 via email

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

2 participants