Files
29d22a17b7 Parse discard binding (#17163)
* add VoidPattern definition

* update types artifacts

* parse void binding

* print void binding

* fix typing errors

* update parser typings

* fix: remove VoidPattern from ForXStatement.left

* fix typing errors

* add Babel 8 tests

* require syntaxType option

* add test for object-rest-spread change

* feat(types): disallow void pattern in var/let/const declaration

* fix: allow nested void pattern in catch param

* improve UnexpectedVoidPattern error message

* remove R&T integration parser tests

* polish: throw different error when CoverDiscardElement is parsed

* Update expression.ts

Co-authored-by: liuxingbaoyu <[email protected]>

* update discardBinding plugin option types

---------

Co-authored-by: liuxingbaoyu <[email protected]>
2025-06-28 08:17:58 +02:00

37 lines
651 B
JavaScript

{
// destructuring binding
const { void: void } = value;
}
{
// for-of destructuring binding
for (const { p: void } of []);
}
{
// destructuring assignment
({ p: void } = {});
}
{
// for-of destructuring assignment
for ({ p: void } of []);
}
{
// function param
function f({ q: { q: { p: void }, p: void }, p: void }) {}
}
{
// arrow function param
({ q: { q: { p: void }, p: void }, p: void }) => {}
}
{
// async arrow function param
async ({ q: { q: { p: void }, p: void }, p: void }) => {}
}
{
// destructuring assignment in async call
async({ p: void } = {});
}
{
// catch param
try {} catch ({ p: void }) {}
}