kripod / kripod/tc39-proposal-private-function-arguments

How does this work with a rest arg?

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```js
function f(n, ...a, #b, #c = 1) {
return [n, a, b, c, f(n + 10, ...a.map(x => x + 10), 'b', 'c')];
}
assert.equal(f.length, 1);
f(1, 2, 3, 4) // ?
```

It seems unacceptable to me to ban mixing a rest arg with a private arg; what would the output here be for this function call assuming it worked?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the function example and call in the issue, then determine how a rest argument and private arguments should interact. Done means the proposal has a clear, agreed-upon answer for the call's behavior and whether this combination is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.