tc39 / tc39/ecmarkup

Completion record linting doesn't work quite right with parentheses

Open
#529 9 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

In Temporal I have an operation RoundDuration which returns "either a normal completion containing a Record with fields [[DurationRecord]] (a Duration Record) and [[Total]] (a mathematical value), or a throw completion". I'm trying to access one of the fields on the returned Record without making an intermediate binding:

  1. Let result be (? RoundDuration(arguments)).[[DurationRecord]].

This results in the error "RoundDuration returns a Completion Record, but is not consumed as if it does" from ecmarkup.

Changing it to this makes the error go away:

  1. Let roundRecord be ? RoundDuration(arguments).
  2. Set result to roundRecord.[[DurationRecord]].

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

Start by reproducing the ecmarkup lint error with the RoundDuration example in the issue, then trace the completion-record linting path for parenthesized field access. Done means direct access to [[DurationRecord]] after ? RoundDuration(arguments) is accepted while invalid unconsumed completion records still produce an error.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.