Improve yield support and restrict usage of strict

- Partially reverting 91cdb93e57 and eaf3911c31 and reimplement
- Add generators support for objects and classes
- Only classes can have static methods so restrict use of it

Special thanks to @rvanvelzen and @kzc for reviewing this patch and
providing constructive feedback over and over again.
This commit is contained in:
Anthony Van de Gejuchte
2016-05-26 17:00:37 +02:00
parent 8ad8d7b717
commit dcfc514c38
10 changed files with 318 additions and 32 deletions

View File

@@ -196,6 +196,10 @@ TreeTransformer.prototype = new TreeWalker;
self.property = self.property.transform(tw);
});
_(AST_Yield, function(self, tw){
if (self.expression) self.expression = self.expression.transform(tw);
});
_(AST_Unary, function(self, tw){
self.expression = self.expression.transform(tw);
});