Skip to content

Proposal: Logical Assignment Operators#7385

Merged
jridgewell merged 4 commits intobabel:masterfrom
jridgewell:logical-assignment-operators
Feb 18, 2018
Merged

Proposal: Logical Assignment Operators#7385
jridgewell merged 4 commits intobabel:masterfrom
jridgewell:logical-assignment-operators

Conversation

@jridgewell
Copy link
Copy Markdown
Member

@jridgewell jridgewell commented Feb 16, 2018

https://github.com/jridgewell/proposal-logical-assignment, which I'll hopefully be presenting in March.

I'm bringing it back. 😉

EDIT by @hzoo: test it out here

@jridgewell jridgewell force-pushed the logical-assignment-operators branch from 6d91bcc to 4aa40e1 Compare February 16, 2018 08:47
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Feb 16, 2018

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/6907/

if (next === code) {
const assign =
this.hasPlugin("logicalAssignment") &&
this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you use this.expectPlugin?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@hzoo
Copy link
Copy Markdown
Member

hzoo commented Feb 18, 2018

I want to be able to test this in the REPL haha, should we add it to stage 0 or make a -1 lol..

@jridgewell
Copy link
Copy Markdown
Member Author

I don't think stage 0 can be blocked, so my proposal is de-facto stage 0. I'll add it to the preset.

@hzoo
Copy link
Copy Markdown
Member

hzoo commented Feb 18, 2018

Yeah stage -1 only relevant in that it hasn't been presented, but doesn't matter too much if it will be soon. Either way 👍, I guess we should re-think how we signal stage x presets (given there's been a lot of talk about removing them entirely)

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@jridgewell
Copy link
Copy Markdown
Member Author

Done.

@jridgewell jridgewell merged commit 7e90d56 into babel:master Feb 18, 2018
@jridgewell jridgewell deleted the logical-assignment-operators branch February 18, 2018 18:56
@hzoo hzoo added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Feb 23, 2018
aminmarashi pushed a commit to aminmarashi/babel that referenced this pull request Mar 17, 2018
* Proposal: Logical Assignment Operators

https://github.com/jridgewell/proposal-logical-assignment

I'm bringing it [back](babel#516). 😉

* Use expectPlugin

* Add to stage 0 preset

* Add logicalAssignment missing plugin log stuff
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants