fix corner case in inline (#4726)

fixes #4725
This commit is contained in:
Alex Lam S.L
2021-03-03 01:18:02 +00:00
committed by GitHub
parent 955411e065
commit 10ca578ee5
4 changed files with 115 additions and 1 deletions

View File

@@ -1684,6 +1684,8 @@ var AST_ObjectMethod = DEFNODE("ObjectMethod", null, {
$documentation: "A key(){} object property",
_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_ObjectKeyVal);