Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructuring assignment #4872

Merged
merged 4 commits into from
Mar 22, 2016
Merged

Destructuring assignment #4872

merged 4 commits into from
Mar 22, 2016

Conversation

kevinsawicki
Copy link
Contributor

Use destructuring assignment available in Chrome 49 in the places it was previously being when CoffeeScript was used.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

Refs #4065

@@ -582,8 +581,7 @@
};
mkdirSync = fs.mkdirSync;
fs.mkdirSync = function(p, mode) {
var filePath, isAsar, ref;
ref = splitPath(p), isAsar = ref[0], filePath = ref[2];
const [isAsar, , filePath] = splitPath(p);
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't know const [isAsar, , filePath] = splitPath(p); would work. That's cool.

I just tried it in the node (5.8) repl, but destructuring assignment is not ready yet. Is there an electron repl? That would be cool. I tried it in Mancy too, but no 🎲 because even though it's an electron app I think it's just using node under the hood.

screen shot 2016-03-22 at 12 19 37 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I saw this in the mdn docs and was pretty impressed that it is supported.

Yeah, not sure about a repl, there must be one out there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeke opened up #4883 if you want to give that a spin ➿

@zeke
Copy link
Contributor

zeke commented Mar 22, 2016

🐑

kevinsawicki added a commit that referenced this pull request Mar 22, 2016
@kevinsawicki kevinsawicki merged commit 6041c7e into master Mar 22, 2016
@kevinsawicki kevinsawicki deleted the destructured-assignment branch March 22, 2016 20:57
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.

None yet

2 participants