fix class extends expression (#1956)
This commit is contained in:
@@ -1474,10 +1474,20 @@ function OutputStream(options) {
|
|||||||
output.space();
|
output.space();
|
||||||
}
|
}
|
||||||
if (self.extends) {
|
if (self.extends) {
|
||||||
|
var parens = self.extends instanceof AST_Binary ||
|
||||||
|
self.extends instanceof AST_Conditional;
|
||||||
output.print("extends");
|
output.print("extends");
|
||||||
output.space();
|
if (parens) {
|
||||||
|
output.print("(");
|
||||||
|
} else {
|
||||||
|
output.space();
|
||||||
|
}
|
||||||
self.extends.print(output);
|
self.extends.print(output);
|
||||||
output.space();
|
if (parens) {
|
||||||
|
output.print(")");
|
||||||
|
} else {
|
||||||
|
output.space();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (self.properties.length > 0) output.with_block(function(){
|
if (self.properties.length > 0) output.with_block(function(){
|
||||||
self.properties.forEach(function(prop, i){
|
self.properties.forEach(function(prop, i){
|
||||||
|
|||||||
@@ -533,3 +533,15 @@ issue_1753_disable: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class_extends_expression: {
|
||||||
|
options = {
|
||||||
|
evaluate: true
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
class bin extends (a || b) {}
|
||||||
|
class seq extends (a, b) {}
|
||||||
|
class ter extends (a ? b : c) {}
|
||||||
|
}
|
||||||
|
expect_exact: "class bin extends(a||b){}class seq extends(a,b){}class ter extends(a?b:c){}"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user