parent
2f220de204
commit
41d92c1187
|
@ -267,6 +267,10 @@ FPp.needsParens = function(assumeExpressionContext) {
|
|||
}
|
||||
|
||||
case "BinaryExpression":
|
||||
if (node.operator === "in" && parent.type === "ForStatement" && parent.init === node) {
|
||||
return true;
|
||||
}
|
||||
|
||||
case "LogicalExpression":
|
||||
switch (parent.type) {
|
||||
case "CallExpression":
|
||||
|
|
|
@ -292,6 +292,14 @@ for (var i = 0; i < 10; ++i) {
|
|||
"
|
||||
`;
|
||||
|
||||
exports[`test in.js 1`] = `
|
||||
"for ((x in a);;) {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
for ((x in a); ; ) {
|
||||
}
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`test var.js 1`] = `
|
||||
"for (a in b) var c = {}; [];
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
for ((x in a);;) {}
|
Loading…
Reference in New Issue