fix corner cases with await (#4350)

fixes #4349
This commit is contained in:
Alex Lam S.L
2020-12-08 03:26:03 +00:00
committed by GitHub
parent 5fba98608c
commit 4733159782
4 changed files with 88 additions and 19 deletions

View File

@@ -551,7 +551,7 @@ function is_function(node) {
return node instanceof AST_AsyncFunction || node instanceof AST_Function;
}
var AST_AsyncFunction = DEFNODE("AsyncFunction", null, {
var AST_AsyncFunction = DEFNODE("AsyncFunction", "inlined", {
$documentation: "An asynchronous function expression",
_validate: function() {
if (this.name != null) {
@@ -573,7 +573,7 @@ function is_defun(node) {
return node instanceof AST_AsyncDefun || node instanceof AST_Defun;
}
var AST_AsyncDefun = DEFNODE("AsyncDefun", null, {
var AST_AsyncDefun = DEFNODE("AsyncDefun", "inlined", {
$documentation: "An asynchronous function definition",
_validate: function() {
if (!(this.name instanceof AST_SymbolDefun)) throw new Error("name must be AST_SymbolDefun");