File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -21865,7 +21865,7 @@ namespace ts {
21865
21865
diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
21866
21866
}
21867
21867
if (diagnosticMessage) {
21868
- const withMinus = isMinusPrefixUnaryExpression (node.parent);
21868
+ const withMinus = isPrefixUnaryExpression (node.parent) && node.parent.operator === SyntaxKind.MinusToken ;
21869
21869
const literal = `${withMinus ? "-" : ""}0o${node.text}`;
21870
21870
return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);
21871
21871
}
Original file line number Diff line number Diff line change @@ -742,9 +742,8 @@ namespace ts {
742
742
return false ;
743
743
}
744
744
745
- export function isMinusPrefixUnaryExpression ( node : Node ) : boolean {
746
- return node . kind === SyntaxKind . PrefixUnaryExpression &&
747
- ( node as PrefixUnaryExpression ) . operator === SyntaxKind . MinusToken ;
745
+ export function isPrefixUnaryExpression ( node : Node ) : node is PrefixUnaryExpression {
746
+ return node . kind === SyntaxKind . PrefixUnaryExpression ;
748
747
}
749
748
750
749
// Warning: This has the same semantics as the forEach family of functions,
You can’t perform that action at this time.
0 commit comments