Skip to content

Conversation

@mofeiZ
Copy link
Contributor

@mofeiZ mofeiZ commented Mar 4, 2025

See newly added test fixtures. Repros fixed in later prs of this stack

/**
* TODO fixture for granular iterator semantics:
* 1. ConditionallyMutate the iterator itself, depending on whether the iterator
Copy link
Member

Choose a reason for hiding this comment

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

there's no iterator in this example?

Comment on lines +17 to +25
/**
* Note that mutableIterator is mutated by the later object spread. Therefore,
* `s.values()` should be memoized within the same block as the object spread.
* In terms of compiler internals, they should have the same reactive scope.
*/
const s = new Set([1, 5, 4]);
const mutableIterator = s.values();

return [arg, ...mutableIterator];
Copy link
Member

Choose a reason for hiding this comment

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

ohhh, nice find

@mofeiZ mofeiZ merged commit 3456b66 into main Mar 12, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants