Fix case where a lonely var is used as computed property
This commit is contained in:
committed by
Richard van Velzen
parent
5f6825f9ec
commit
c2112d5886
@@ -1508,7 +1508,7 @@ function OutputStream(options) {
|
||||
) {
|
||||
self.print_property_name(self.key, self.quote, output);
|
||||
} else {
|
||||
if (!(self.key instanceof AST_Node) || self.key instanceof AST_Symbol) {
|
||||
if (!(self.key instanceof AST_Node)) {
|
||||
self.print_property_name(self.key, self.quote, output);
|
||||
} else {
|
||||
output.with_square(function() {
|
||||
|
||||
@@ -491,3 +491,14 @@ allow_assignments_to_property_values: {
|
||||
var foo = {123: foo = 123} = {foo: "456"};
|
||||
}
|
||||
}
|
||||
|
||||
variable_as_computed_property: {
|
||||
input: {
|
||||
function getLine(header) {
|
||||
return {
|
||||
[header]: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
expect_exact: "function getLine(header){return{[header]:{}}}"
|
||||
}
|
||||
Reference in New Issue
Block a user