File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21865,7 +21865,7 @@ namespace ts {
2186521865 diagnosticMessage = Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
2186621866 }
2186721867 if (diagnosticMessage) {
21868- const withMinus = isMinusPrefixUnaryExpression (node.parent);
21868+ const withMinus = isPrefixUnaryExpression (node.parent) && node.parent.operator === SyntaxKind.MinusToken ;
2186921869 const literal = `${withMinus ? "-" : ""}0o${node.text}`;
2187021870 return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);
2187121871 }
Original file line number Diff line number Diff line change @@ -742,9 +742,8 @@ namespace ts {
742742 return false ;
743743 }
744744
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 ;
748747 }
749748
750749 // Warning: This has the same semantics as the forEach family of functions,
You can’t perform that action at this time.
0 commit comments