fix corner cases with class (#4723)

fixes #4720
fixes #4721
fixes #4722
This commit is contained in:
Alex Lam S.L
2021-03-02 19:32:58 +00:00
committed by GitHub
parent adcafce048
commit 955411e065
3 changed files with 148 additions and 8 deletions

View File

@@ -874,6 +874,7 @@ var AST_ClassMethod = DEFNODE("ClassMethod", null, {
$documentation: "A `class` method",
_validate: function() {
if (!(this.value instanceof AST_LambdaExpression)) throw new Error("value must be AST_LambdaExpression");
if (is_arrow(this.value)) throw new Error("value cannot be AST_Arrow or AST_AsyncArrow");
if (this.value.name != null) throw new Error("name of class method's lambda must be null");
},
}, AST_ClassProperty);