Skip to content

Commit 4bc98ae

Browse files
committed
a
1 parent 8f39283 commit 4bc98ae

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/Runtime/Base/FunctionBody.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,7 @@ namespace Js
13191319
bool IsClassMethod() const;
13201320
bool IsModule() const;
13211321
bool HasSuperReference() const;
1322+
bool IsCoroutine() const;
13221323
bool GetCapturesThis() const;
13231324
void SetCapturesThis();
13241325
bool GetEnclosedByGlobalFunc() const;
@@ -1525,6 +1526,13 @@ namespace Js
15251526
return GetFunctionInfo()->HasSuperReference();
15261527
}
15271528

1529+
inline bool FunctionProxy::IsCoroutine() const
1530+
{
1531+
Assert(GetFunctionInfo());
1532+
Assert(GetFunctionInfo()->GetFunctionProxy() == this);
1533+
return GetFunctionInfo()->IsCoroutine();
1534+
}
1535+
15281536
inline bool FunctionProxy::GetCapturesThis() const
15291537
{
15301538
Assert(GetFunctionInfo());

lib/Runtime/Library/JavascriptFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ namespace Js
239239

240240
scriptContext->AddToNewFunctionMap(key, functionInfo->GetFunctionInfo());
241241
}
242-
else if (pfuncInfoCache->IsGenerator())
242+
else if (pfuncInfoCache->IsCoroutine())
243243
{
244244
pfuncScript = scriptContext->GetLibrary()->CreateGeneratorVirtualScriptFunction(pfuncInfoCache->GetFunctionProxy());
245245
}

0 commit comments

Comments
 (0)