Fix parenthesis for UpdateExpression (#198)
```js (this.x++).toString() ``` no longer drops the parenthesismaster
parent
f70c9ec6d1
commit
fe72aecce9
|
@ -228,6 +228,7 @@ FPp.needsParens = function(assumeExpressionContext) {
|
|||
}
|
||||
|
||||
switch (node.type) {
|
||||
case "UpdateExpression":
|
||||
case "UnaryExpression":
|
||||
case "SpreadElement":
|
||||
case "SpreadProperty":
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
exports[`test update_expression.js 1`] = `
|
||||
"(this.x++).toString()
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
(this.x++).toString();
|
||||
"
|
||||
`;
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname);
|
|
@ -0,0 +1 @@
|
|||
(this.x++).toString()
|
Loading…
Reference in New Issue