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 "LogicalExpression": {
|
||||
if (!node.operator) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const po = parent.operator;
|
||||
const pp = util.getPrecedence(po);
|
||||
const no = node.operator;
|
||||
|
|
|
@ -4,11 +4,17 @@ exports[`as.js 1`] = `
|
|||
const name = (description as DescriptionObject).name || (description as string);
|
||||
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
||||
(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);
|
||||
(originalError
|
||||
? wrappedError(errMsg, originalError)
|
||||
: 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);
|
||||
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
||||
(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