Generator parameters must not contain yield expressions
Open
Nobody has claimed this yet.
defect
es6
- Dominant language
- TypeScript
- Stars
- 7.1k
- Forks
- 773
- PR merge metrics
- No merged PRs in 30d
Description
(As reported by @michaelficarra as case 17 in #1502)
Test case:
esprima.parse('function *g(x = yield){}');
Actual: a valid syntax tree.
Expected: a thrown exception indicating a syntax error.
Following V8 error messages, the exception message should be "Yield expression not allowed in formal parameter".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the esprima.parse call in the issue and trace how the parser handles a generator's formal parameter containing yield. Confirm that the example throws a syntax error with the requested message, and add or run a regression test for this input. Done means the invalid syntax is rejected rather than producing a syntax tree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100