Skip to content

Commit e21e77e

Browse files
author
Suwei Chen
committed
Simplify and go straight to functionInfo for GetAllowDirectSuper()
1 parent 46e18ff commit e21e77e

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

lib/Runtime/ByteCode/ByteCodeGenerator.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,14 +2585,9 @@ bool FuncAllowsDirectSuper(FuncInfo *funcInfo, ByteCodeGenerator *byteCodeGenera
25852585
if (funcInfo->IsGlobalFunction() && ((byteCodeGenerator->GetFlags() & fscrEval) != 0))
25862586
{
25872587
Js::JavascriptFunction *caller = nullptr;
2588-
if (Js::JavascriptStackWalker::GetCaller(&caller, byteCodeGenerator->GetScriptContext()) && Js::ScriptFunction::Is(caller))
2588+
if (Js::JavascriptStackWalker::GetCaller(&caller, byteCodeGenerator->GetScriptContext()) && caller->GetFunctionInfo()->GetAllowDirectSuper())
25892589
{
2590-
Js::FunctionBody * callerBody = caller->GetFunctionBody();
2591-
Assert(callerBody);
2592-
if (callerBody->GetFunctionInfo()->GetAllowDirectSuper())
2593-
{
2594-
return true;
2595-
}
2590+
return true;
25962591
}
25972592
}
25982593

0 commit comments

Comments
 (0)