mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
repl: fix await object patterns without values
fix lint issue PR-URL: https://github.com/nodejs/node/pull/53331 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
This commit is contained in:
parent
68c9f554ff
commit
479b8e5232
@ -104,7 +104,7 @@ const visitorsWithoutAncestors = {
|
||||
break;
|
||||
case 'ObjectPattern':
|
||||
ArrayPrototypeForEach(node.properties, (property) => {
|
||||
registerVariableDeclarationIdentifiers(property.value);
|
||||
registerVariableDeclarationIdentifiers(property.value || property.argument);
|
||||
});
|
||||
break;
|
||||
case 'ArrayPattern':
|
||||
|
@ -144,6 +144,9 @@ const testCases = [
|
||||
'(async () => { return { value: ((await x).y) } })()'],
|
||||
[ 'await (await x).y',
|
||||
'(async () => { return { value: (await (await x).y) } })()'],
|
||||
[ 'var { ...rest } = await {}',
|
||||
'var rest; (async () => { void ({ ...rest } = await {}) })()',
|
||||
],
|
||||
];
|
||||
|
||||
for (const [input, expected] of testCases) {
|
||||
|
Loading…
Reference in New Issue
Block a user