Skip to content

Commit 251e536

Browse files
withMinus refactor
1 parent cedd4de commit 251e536

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/scanner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ export function createScanner(languageVersion: ScriptTarget,
11651165
tokenFlags |= TokenFlags.Octal;
11661166
const withMinus = token === SyntaxKind.MinusToken;
11671167
const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8);
1168-
start -= +withMinus;
1168+
if (withMinus) start--;
11691169
error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start, pos - start, literal);
11701170
return { type: SyntaxKind.NumericLiteral, value: tokenValue };
11711171
}

0 commit comments

Comments
 (0)