-
Notifications
You must be signed in to change notification settings - Fork 15k
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
Destructuring assignment #4872
Conversation
db3ac07
to
b784ea7
Compare
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐑 |
b784ea7
to
2d32956
Compare
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