Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
add support for logical assignments with private properties #11702
Patches the logic for handling assignment operators and adds support for
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 25bfbf4:
Right, I was unsure, thanks for letting me know.
@ryzokuken The memoization is done in
The second argument
// obj.self().#a = obj.self().#a + 1 classFieldSet($objSelf = obj.self(), a, classFieldGet($objSelf, a) + 1)
this.set(member, t.binaryExpression("+", this.get(member), value))
We should memoize
// obj.self().#a ?? (obj.self().#a = 1) classFieldGet($objSelf = obj.self(), a) ?? classFieldSet($objSelf, a, 1) // current PR classFieldGet($objSelf, a) ?? classFieldSet($objSelf = obj.self(), a, 1)
t.LogicalExpression("??", this.get(member), this.set(member))
Note that the call sequence is unchanged --
// add some comment about why 1 is chosen for logical expressions this.memoise(member, 1);