We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ecb770 commit e66eb37Copy full SHA for e66eb37
2 files changed
lib/internal/repl/await.js
@@ -104,7 +104,7 @@ const visitorsWithoutAncestors = {
104
break;
105
case 'ObjectPattern':
106
ArrayPrototypeForEach(node.properties, (property) => {
107
- registerVariableDeclarationIdentifiers(property.value);
+ registerVariableDeclarationIdentifiers(property.value || property.argument);
108
});
109
110
case 'ArrayPattern':
test/parallel/test-repl-preprocess-top-level-await.js
@@ -144,6 +144,9 @@ const testCases = [
144
'(async () => { return { value: ((await x).y) } })()'],
145
[ 'await (await x).y',
146
'(async () => { return { value: (await (await x).y) } })()'],
147
+ [ 'var { ...rest } = await {}',
148
+ 'var rest; (async () => { void ({ ...rest } = await {}) })()',
149
+ ],
150
];
151
152
for (const [input, expected] of testCases) {
0 commit comments