Do not attempt evaluating class expressions
Broadly the same as function expressions - these actually are statements but we're limited by the inheritance tree. Fixes #1044
This commit is contained in:
@@ -977,6 +977,9 @@ merge(Compressor.prototype, {
|
|||||||
def(AST_Arrow, function() {
|
def(AST_Arrow, function() {
|
||||||
throw def;
|
throw def;
|
||||||
});
|
});
|
||||||
|
def(AST_Class, function() {
|
||||||
|
throw def;
|
||||||
|
});
|
||||||
function ev(node, compressor) {
|
function ev(node, compressor) {
|
||||||
if (!compressor) throw new Error("Compressor must be passed");
|
if (!compressor) throw new Error("Compressor must be passed");
|
||||||
|
|
||||||
|
|||||||
9
test/compress/issue-1044.js
Normal file
9
test/compress/issue-1044.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
issue_1044: {
|
||||||
|
options = { evaluate: true, conditionals: true };
|
||||||
|
input: {
|
||||||
|
const mixed = Base ? class extends Base {} : class {}
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
const mixed = Base ? class extends Base {} : class {}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user