Skip to content

editorial: add a value liveness note#135

Open
legendecas wants to merge 1 commit intomasterfrom
liveness
Open

editorial: add a value liveness note#135
legendecas wants to merge 1 commit intomasterfrom
liveness

Conversation

@legendecas
Copy link
Copy Markdown
Member

The [[AsyncContextMapping]] is never going to be a WeakMap equivalent storage, providing operations like delete, get, has, or set. It is only intended to say that the value in an Async Context Mapping Record is only necessarily live when its corresponding key is live.

Fixes: #76

@legendecas legendecas force-pushed the liveness branch 2 times, most recently from 65586c9 to 349f5fb Compare September 9, 2025 12:37
Comment thread spec.html

<emu-note>
<p>The value field [[AsyncContextValue]] in the list [[AsyncContextMapping]] of an Agent Record is only intended to be accessed via an [[AsyncContextKey]] field. The list is not iterable through AsyncContext APIs.</p>
<p>The above definition implies that, if a value in the [[AsyncContextKey]] field in an Async Context Mapping Record is not live, then its corresponding value of [[AsyncContextValue]] is not necessarily live either.</p>
Copy link
Copy Markdown
Member

@andreubotella andreubotella Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the semantics here could be better expressed in two steps:

  • A live [[AsyncContextMapping]] does not necessarily keep its [[AsyncContextKey]]s alive
  • For a live [[AsyncContextMapping]], if an [[AsyncContextKey]] is not live, its corresponding [[AsyncContextValue]] is not necessarily kept alive.

nicolo-ribaudo
nicolo-ribaudo previously approved these changes Mar 24, 2026
@nicolo-ribaudo nicolo-ribaudo dismissed their stale review March 24, 2026 16:18

Agree with Andreu's suggestion, but keeping it in a note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should the AsyncContext store be a weak map?

3 participants