tc39 / tc39/ecmarkup

missing variable error in abstract closures should suggest adding the variable to the captures list, if applicable

Open
#649 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
245
Forks
80
Avg merge
10h 46m
Merged PRs (30d)
2

Description

e.g.

1. Let _foo_ be 0.
1. Let _AC_ be a new Abstract Closure with no parameters that captures nothing and performs the following steps when called:
  1. Return _foo_.

This is an error because the AC uses but doesn't capture _foo_, but the error is just "could not find a preceding declaration for _foo_". If the thing being used exists outside the AC the error should suggest adding it to the captures list.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Locate the validation and diagnostic code for missing variables used inside abstract closures, then find the existing tests for that error. Reproduce the example and confirm that, when the variable exists outside the closure, the diagnostic suggests adding it to the captures list.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.