Fix computed getters + cleanup AST

This commit is contained in:
Anthony Van de Gejuchte
2016-07-21 18:02:32 +02:00
parent 88384cf351
commit 3f8fc3a316
3 changed files with 17 additions and 33 deletions

View File

@@ -1457,7 +1457,13 @@ function OutputStream(options) {
}
output.print("set");
output.space();
self.key.print(output);
if (self.key instanceof AST_SymbolMethod) {
self.key.print(output);
} else {
output.with_square(function() {
self.key.print(output);
});
}
self.value._do_print(output, true);
});
DEFPRINT(AST_ObjectGetter, function(self, output){
@@ -1467,7 +1473,13 @@ function OutputStream(options) {
}
output.print("get");
output.space();
self.key.print(output);
if (self.key instanceof AST_SymbolMethod) {
self.key.print(output);
} else {
output.with_square(function() {
self.key.print(output);
});
}
self.value._do_print(output, true);
});
DEFPRINT(AST_ObjectComputedKeyVal, function(self, output) {
@@ -1493,15 +1505,6 @@ function OutputStream(options) {
self.default.print(output)
}
});
DEFPRINT(AST_SymbolMethod, function(self, output) {
if (self.name instanceof AST_Node) {
output.with_square(function() {
self.name.print(output);
});
} else {
self._do_print(output);
}
});
DEFPRINT(AST_Undefined, function(self, output){
output.print("void 0");
});