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

@@ -575,6 +575,8 @@ AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){
base54.consider("catch");
else if (node instanceof AST_Finally)
base54.consider("finally");
else if (node instanceof AST_Yield)
base54.consider("yield");
else if (node instanceof AST_Symbol && node.unmangleable(options))
base54.consider(node.name);
else if (node instanceof AST_Unary || node instanceof AST_Binary)