mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
457ed57ff2
The parameter check only recognized `FormalParameter`, allowing `await` and `yield` in destructuring defaults inside rest parameters:
```js
async function f(...[x = await 0]) {}
function* g(...[x = yield 0]) {}
```
Include `FormalParameterRest` so both cases report the existing parameter diagnostic. The check still stops at nested functions, where `await` and `yield` can be valid.
3 lines
101 B
JavaScript
3 lines
101 B
JavaScript
async function f(...[x = async () => await 0]) {}
|
|
function* g(...[x = function* () { yield 0; }]) {}
|