Skip to content

Conversation

@vercel
Copy link

vercel bot commented Jul 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 9:43pm

mofeiZ added a commit that referenced this pull request Jul 25, 2024
ghstack-source-id: 962af1e
Pull Request resolved: #30471
@mofeiZ mofeiZ marked this pull request as ready for review July 26, 2024 21:32
loc: exprLoc,
});
return {kind: 'LoadLocal', place: identifier, loc: exprLoc};
const binding = builder.resolveIdentifier(leftExpr);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the key change: we check if the identifier is a local (or non-local) binding

Comment on lines +1948 to +1972
const identifier = lowerIdentifier(builder, leftExpr);
const kind = getStoreKind(builder, leftExpr);
if (kind === 'StoreLocal') {
lowerValueToTemporary(builder, {
kind: 'StoreLocal',
lvalue: {
place: {...identifier},
kind: InstructionKind.Reassign,
},
value: {...binaryPlace},
type: null,
loc: exprLoc,
});
return {kind: 'LoadLocal', place: identifier, loc: exprLoc};
} else {
lowerValueToTemporary(builder, {
kind: 'StoreContext',
lvalue: {
place: {...identifier},
kind: InstructionKind.Reassign,
},
value: {...binaryPlace},
loc: exprLoc,
});
return {kind: 'LoadContext', place: identifier, loc: exprLoc};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Only whitespace changes here)

mofeiZ added a commit that referenced this pull request Jul 26, 2024
ghstack-source-id: aff6606
Pull Request resolved: #30471
@mofeiZ mofeiZ merged commit 9c70244 into gh/mofeiZ/18/base Jul 29, 2024
mofeiZ added a commit that referenced this pull request Jul 29, 2024
ghstack-source-id: aff6606
Pull Request resolved: #30471
@mofeiZ mofeiZ deleted the gh/mofeiZ/18/head branch July 29, 2024 17:18
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