Remove parens from chained assignments (#967)

master
Brian Ng 2017-03-09 11:17:16 -06:00 committed by Christopher Chedeau
parent 344401c038
commit d034564481
4 changed files with 12 additions and 0 deletions

View File

@ -424,6 +424,8 @@ FPp.needsParens = function(assumeExpressionContext) {
return false;
} else if (parent.type === "ExpressionStatement") {
return node.left.type === "ObjectPattern";
} else if (parent.type === "AssignmentExpression") {
return false;
}
return true;

View File

@ -0,0 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`assignment_expression.js 1`] = `
"this.size = this._origin = this._capacity = 0;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this.size = this._origin = this._capacity = 0;
"
`;

View File

@ -0,0 +1 @@
this.size = this._origin = this._capacity = 0;

View File

@ -0,0 +1 @@
run_spec(__dirname);