mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Properly disallow yield in bodyless arrows (#61976)
This commit is contained in:
@@ -5559,12 +5559,15 @@ namespace Parser {
|
||||
return parseFunctionBlock(SignatureFlags.IgnoreMissingOpenBrace | (isAsync ? SignatureFlags.Await : SignatureFlags.None));
|
||||
}
|
||||
|
||||
const savedYieldContext = inYieldContext();
|
||||
setYieldContext(false);
|
||||
const savedTopLevel = topLevel;
|
||||
topLevel = false;
|
||||
const node = isAsync
|
||||
? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction))
|
||||
: doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction));
|
||||
topLevel = savedTopLevel;
|
||||
setYieldContext(savedYieldContext);
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user