Properly add parenthesis for as inside of binary expression (#1698)
The binary logic doesn't work if the node isn't a binary or logical expressionmaster
parent
cd60e020c3
commit
7cd0b78fe7
|
@ -340,6 +340,10 @@ FPp.needsParens = function() {
|
||||||
|
|
||||||
case "BinaryExpression":
|
case "BinaryExpression":
|
||||||
case "LogicalExpression": {
|
case "LogicalExpression": {
|
||||||
|
if (!node.operator) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const po = parent.operator;
|
const po = parent.operator;
|
||||||
const pp = util.getPrecedence(po);
|
const pp = util.getPrecedence(po);
|
||||||
const no = node.operator;
|
const no = node.operator;
|
||||||
|
|
|
@ -4,11 +4,17 @@ exports[`as.js 1`] = `
|
||||||
const name = (description as DescriptionObject).name || (description as string);
|
const name = (description as DescriptionObject).name || (description as string);
|
||||||
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
||||||
(originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;
|
(originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;
|
||||||
|
'current' in (props.pagination as Object)
|
||||||
|
start + (yearSelectTotal as number)
|
||||||
|
scrollTop > (visibilityHeight as number)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
const name = (description as DescriptionObject).name || description as string;
|
const name = (description as DescriptionObject).name || (description as string);
|
||||||
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
||||||
(originalError
|
(originalError
|
||||||
? wrappedError(errMsg, originalError)
|
? wrappedError(errMsg, originalError)
|
||||||
: Error(errMsg)) as InjectionError;
|
: Error(errMsg)) as InjectionError;
|
||||||
|
"current" in (props.pagination as Object);
|
||||||
|
start + (yearSelectTotal as number);
|
||||||
|
scrollTop > (visibilityHeight as number);
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
const name = (description as DescriptionObject).name || (description as string);
|
const name = (description as DescriptionObject).name || (description as string);
|
||||||
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
||||||
(originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;
|
(originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;
|
||||||
|
'current' in (props.pagination as Object)
|
||||||
|
start + (yearSelectTotal as number)
|
||||||
|
scrollTop > (visibilityHeight as number)
|
||||||
|
|
Loading…
Reference in New Issue