summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShelley Vohr <shelley.vohr@gmail.com>2018-10-23 22:34:03 -0700
committerMichaƫl Zasso <targos@protonmail.com>2018-10-28 15:07:45 +0100
commit35f9cd22f53639624c77b1af84affe4d7ae9cfb8 (patch)
tree9167be780a61501f898717f5cdd3e3e11b194ebe /lib
parent0fd55e71fe376458d1d82503a643114db8675208 (diff)
downloadandroid-node-v8-35f9cd22f53639624c77b1af84affe4d7ae9cfb8.tar.gz
android-node-v8-35f9cd22f53639624c77b1af84affe4d7ae9cfb8.tar.bz2
android-node-v8-35f9cd22f53639624c77b1af84affe4d7ae9cfb8.zip
repl: support top-level for-await-of
PR-URL: https://github.com/nodejs/node/pull/23841 Fixes: https://github.com/nodejs/node/issues/23836 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/repl/await.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/internal/repl/await.js b/lib/internal/repl/await.js
index e0b79805df..2f3e754b5d 100644
--- a/lib/internal/repl/await.js
+++ b/lib/internal/repl/await.js
@@ -11,6 +11,12 @@ const visitorsWithoutAncestors = {
}
walk.base.ClassDeclaration(node, state, c);
},
+ ForOfStatement(node, state, c) {
+ if (node.await === true) {
+ state.containsAwait = true;
+ }
+ walk.base.ForOfStatement(node, state, c);
+ },
FunctionDeclaration(node, state, c) {
state.prepend(node, `${node.id.name}=`);
},