Fix parsing setters/getters (allow keywords for name).

The "key" property was always "set" or "get", which didn't make much sense.
Now it'll be the actual name of the setter/getter (AST_Node), and the
AST_Accessor object itself, which represents the function, won't store any
name.

Close #319
This commit is contained in:
Mihai Bazon
2013-10-30 11:50:22 +02:00
parent b70670b69f
commit c5ed2292bf
3 changed files with 28 additions and 25 deletions

View File

@@ -1066,10 +1066,14 @@ function OutputStream(options) {
});
DEFPRINT(AST_ObjectSetter, function(self, output){
output.print("set");
output.space();
self.key.print(output);
self.value._do_print(output, true);
});
DEFPRINT(AST_ObjectGetter, function(self, output){
output.print("get");
output.space();
self.key.print(output);
self.value._do_print(output, true);
});
DEFPRINT(AST_Symbol, function(self, output){