Skip to content

Commit dd80e87

Browse files
committed
Set experimentalDecorators warning for JavaScript
(cherry picked from commit ed7abcc)
1 parent d396f6e commit dd80e87

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12827,7 +12827,7 @@ namespace ts {
1282712827
}
1282812828

1282912829
if (!compilerOptions.experimentalDecorators) {
12830-
error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
12830+
error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_experimentalDecorators_to_remove_this_warning);
1283112831
}
1283212832

1283312833
if (compilerOptions.emitDecoratorMetadata) {

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@
679679
"category": "Error",
680680
"code": 1218
681681
},
682-
"Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.": {
682+
"Experimental support for decorators is a feature that is subject to change in a future release. Set 'experimentalDecorators' to remove this warning.": {
683683
"category": "Error",
684684
"code": 1219
685685
},

src/compiler/program.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,11 @@ namespace ts {
827827
let typeAssertionExpression = <TypeAssertion>node;
828828
diagnostics.push(createDiagnosticForNode(typeAssertionExpression.type, Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
829829
return true;
830+
case SyntaxKind.Decorator:
831+
if (!options.experimentalDecorators) {
832+
diagnostics.push(createDiagnosticForNode(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_experimentalDecorators_to_remove_this_warning))
833+
}
834+
return true;
830835
}
831836

832837
return forEachChild(node, walk);

0 commit comments

Comments
 (0)