mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Keep Disallowing return in ambient locations
This commit is contained in:
@@ -38913,7 +38913,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (!container) {
|
||||
if (!!getSourceFileOfNode(node).externalModuleIndicator) {
|
||||
if (!!getSourceFileOfNode(node).externalModuleIndicator || node.flags & NodeFlags.Ambient) {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user