From f7ad54b432c2fc0fc437f3e25be03c34a2040e4f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 9 Nov 2018 16:20:54 -0800 Subject: [PATCH] Only complain about BigInt literals in pre-ESNext targets. --- src/compiler/checker.ts | 5 +---- src/compiler/commandLineParser.ts | 6 ------ src/compiler/diagnosticMessages.json | 10 +--------- src/compiler/types.ts | 1 - 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f06a284a729..1ae0817358a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30528,13 +30528,10 @@ namespace ts { isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent); if (!literalType) { if (languageVersion < ScriptTarget.ESNext) { - if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targetting_lower_than_ESNext)) { + if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ESNext)) { return true; } } - if (!compilerOptions.experimentalBigInt) { - return grammarErrorOnNode(node, Diagnostics.Experimental_support_for_BigInt_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalBigInt_option_to_remove_this_warning); - } } return false; } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e3b6fe69d21..972336967dc 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -584,12 +584,6 @@ namespace ts { category: Diagnostics.Experimental_Options, description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators }, - { - name: "experimentalBigInt", - type: "boolean", - category: Diagnostics.Experimental_Options, - description: Diagnostics.Enables_experimental_support_for_ESNext_BigInt_literals - }, // Advanced { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3ba74f03073..b8509cae1e5 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1011,10 +1011,6 @@ "category": "Message", "code": 1350 }, - "Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.": { - "category": "Error", - "code": 1351 - }, "Duplicate identifier '{0}'.": { "category": "Error", @@ -2505,7 +2501,7 @@ "category": "Error", "code": 2736 }, - "BigInt literals are not available when targetting lower than ESNext.": { + "BigInt literals are not available when targeting lower than ESNext.": { "category": "Error", "code": 2737 }, @@ -3921,10 +3917,6 @@ "category": "Error", "code": 6370 }, - "Enables experimental support for ESNext BigInt literals.": { - "category": "Message", - "code": 6371 - }, "The expected type comes from property '{0}' which is declared here on type '{1}'": { "category": "Message", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 45e63475924..65a04d43949 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4495,7 +4495,6 @@ namespace ts { downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; - experimentalBigInt?: boolean; experimentalDecorators?: boolean; forceConsistentCasingInFileNames?: boolean; /*@internal*/help?: boolean;