Various property fixes
* Implement getter/setter with computed value * Fix parsing getter/setter after static or generator token * Allow storing expressions for computed expression in AST_SymbolMethod * Allow get and set in shorthand properties in object literals Fixes #1094, #1146 and #1221
This commit is contained in:
committed by
Richard van Velzen
parent
766fafda8b
commit
72a9d799b6
@@ -887,8 +887,12 @@ function OutputStream(options) {
|
||||
output.space();
|
||||
}
|
||||
}
|
||||
if (self.name) {
|
||||
if (self.name instanceof AST_Symbol) {
|
||||
self.name.print(output);
|
||||
} else if (nokeyword && self.name instanceof AST_Node) {
|
||||
output.with_square(function() {
|
||||
self.name.print(output); // Computed method name
|
||||
});
|
||||
}
|
||||
output.with_parens(function(){
|
||||
self.argnames.forEach(function(arg, i){
|
||||
@@ -1489,6 +1493,15 @@ 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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user