futtta/autoptimize

Minified JS broken with private class identifiers

Closed this issue · 4 comments

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.

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.

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