mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Removed excess new check
This commit is contained in:
@@ -975,9 +975,8 @@ namespace ts {
|
||||
result = text.substring(start, end); // No need to use all the fragments; no _ removal needed
|
||||
}
|
||||
|
||||
checkForIdentifierAfterNumericLiteral();
|
||||
if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) {
|
||||
checkForIdentifierAfterNumericLiteral();
|
||||
checkForIdentifierStartAfterNumericLiteral();
|
||||
return {
|
||||
type: SyntaxKind.NumericLiteral,
|
||||
value: "" + +result // if value is not an integer, it can be safely coerced to a number
|
||||
@@ -986,12 +985,12 @@ namespace ts {
|
||||
else {
|
||||
tokenValue = result;
|
||||
const type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint
|
||||
checkForIdentifierAfterNumericLiteral();
|
||||
checkForIdentifierStartAfterNumericLiteral();
|
||||
return { type, value: tokenValue };
|
||||
}
|
||||
}
|
||||
|
||||
function checkForIdentifierAfterNumericLiteral() {
|
||||
function checkForIdentifierStartAfterNumericLiteral() {
|
||||
if (isIdentifierStart(text.charCodeAt(pos), languageVersion)) {
|
||||
error(Diagnostics.An_identifier_cannot_follow_a_numeric_literal, pos, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user