support async function (#4333)

This commit is contained in:
Alex Lam S.L
2020-12-06 21:22:40 +00:00
committed by GitHub
parent 3c384cf9a8
commit 2cbbf5c375
11 changed files with 434 additions and 62 deletions

View File

@@ -112,7 +112,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
var next_def_id = 0;
var scope = self.parent_scope = null;
var tw = new TreeWalker(function(node, descend) {
if (node instanceof AST_Defun) {
if (node instanceof AST_AsyncDefun || node instanceof AST_Defun) {
node.name.walk(tw);
walk_scope(function() {
node.argnames.forEach(function(argname) {