Skip to content

Compressor does not understand classes #78

@plasma4

Description

@plasma4

When I try to compress a script with a class on the site (https://jscompress.com), it gives me an error. Take this simple example:

class MyClass {
    constructor(item) {
        this.item = item
    }

    thing() {
        alert(this.item)
    }
}

new MyClass()

It gives me this an error:
Unexpected token: name «MyClass», expected: punc «;» (line: 1, col: 6)

I would really like class compression, as it is supported in a lot of browsers:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions