Files
oxc-project__oxc/tasks/coverage/misc/pass/rest-parameter-default-nested-functions.js
camc314 457ed57ff2 fix(semantic): reject await and yield in rest parameter defaults (#26359)
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.
2026-09-06 08:36:56 +00:00

3 lines
101 B
JavaScript

async function f(...[x = async () => await 0]) {}
function* g(...[x = function* () { yield 0; }]) {}