parent
9399c1b656
commit
f106b1ec97
|
@ -419,6 +419,7 @@ FPp.needsParens = function(assumeExpressionContext) {
|
||||||
case "LogicalExpression":
|
case "LogicalExpression":
|
||||||
case "NewExpression":
|
case "NewExpression":
|
||||||
case "ExportDefaultDeclaration":
|
case "ExportDefaultDeclaration":
|
||||||
|
case "AwaitExpression":
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "CallExpression":
|
case "CallExpression":
|
||||||
|
|
|
@ -18,9 +18,19 @@ exports[`test conditional-expression.js 1`] = `
|
||||||
"async function f() {
|
"async function f() {
|
||||||
const result = typeof fn === \'function\' ? await fn() : null;
|
const result = typeof fn === \'function\' ? await fn() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(async function() {
|
||||||
|
console.log(
|
||||||
|
await (true ? Promise.resolve(\"A\") : Promise.resolve(\"B\"))
|
||||||
|
);
|
||||||
|
})()
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
async function f() {
|
async function f() {
|
||||||
const result = typeof fn === \"function\" ? await fn() : null;
|
const result = typeof fn === \"function\" ? await fn() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(async function() {
|
||||||
|
console.log(await (true ? Promise.resolve(\"A\") : Promise.resolve(\"B\")));
|
||||||
|
})();
|
||||||
"
|
"
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
async function f() {
|
async function f() {
|
||||||
const result = typeof fn === 'function' ? await fn() : null;
|
const result = typeof fn === 'function' ? await fn() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(async function() {
|
||||||
|
console.log(
|
||||||
|
await (true ? Promise.resolve("A") : Promise.resolve("B"))
|
||||||
|
);
|
||||||
|
})()
|
||||||
|
|
Loading…
Reference in New Issue