diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 3c75580e7e7..b55fd53e0cc 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -760,11 +760,7 @@ module ts { while (true) { var ch = text.charCodeAt(pos); var valueOfCh = ch - CharacterCodes._0; - if (!isDigit(ch)) { - break; - } - // We know at this point that ch must be digit - if (valueOfCh >= base) { + if (!isDigit(ch) || valueOfCh >= base) { break; } value = value * base + valueOfCh;