diff options
Diffstat (limited to 'lib/ast.js')
-rw-r--r-- | lib/ast.js | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -1176,15 +1176,7 @@ var AST_ExportDefault = DEFNODE("ExportDefault", "body", { }); }, _validate: function() { - if (this.body instanceof AST_Class && this.body.name) { - if (!(this.body instanceof AST_DefClass)) { - throw new Error("body must be AST_DefClass when named"); - } - } else if (this.body instanceof AST_Lambda && this.body.name) { - if (!(this.body instanceof AST_LambdaDefinition)) { - throw new Error("body must be AST_LambdaDefinition when named"); - } - } else { + if (!(this.body instanceof AST_DefClass || this.body instanceof AST_LambdaDefinition)) { must_be_expression(this, "body"); } }, |