Do it correctly.

This commit is contained in:
Daniel Rosenwasser 2018-08-15 09:00:23 -07:00
parent 31d8cbe895
commit dac00d97b7

View file

@ -15473,7 +15473,7 @@ namespace ts {
// With noImplicitThis, functions may not reference 'this' if it has type 'any'
error(
node,
capturedByArrowFunction ?
capturedByArrowFunction && container.kind === SyntaxKind.SourceFile ?
Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any :
Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
}