do not suggest to mark constructor 'async'
This commit is contained in:
parent
8e9556a860
commit
1fd9de3214
1 changed files with 2 additions and 2 deletions
|
@ -23093,7 +23093,7 @@ namespace ts {
|
|||
const span = getSpanOfTokenAtPosition(sourceFile, node.pos);
|
||||
const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expression_is_only_allowed_within_an_async_function);
|
||||
const func = getContainingFunction(node);
|
||||
if (func) {
|
||||
if (func && func.kind !== SyntaxKind.Constructor) {
|
||||
Debug.assert((getFunctionFlags(func) & FunctionFlags.Async) === 0, "Enclosing function should never be an async function.");
|
||||
const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
|
||||
addRelatedInfo(diagnostic, relatedInfo);
|
||||
|
@ -31603,7 +31603,7 @@ namespace ts {
|
|||
if (!hasParseDiagnostics(sourceFile)) {
|
||||
const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator);
|
||||
const func = getContainingFunction(forInOrOfStatement);
|
||||
if (func) {
|
||||
if (func && func.kind !== SyntaxKind.Constructor) {
|
||||
Debug.assert((getFunctionFlags(func) & FunctionFlags.Async) === 0, "Enclosing function should never be an async function.");
|
||||
const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async);
|
||||
addRelatedInfo(diagnostic, relatedInfo);
|
||||
|
|
Loading…
Reference in a new issue