Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakra Automation authored and pleath committed Mar 6, 2020
1 parent a0e8946 commit bdd48f2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Runtime/Types/DeferredTypeHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Js
{
undeferredFunctionType = functionProxy->GetUndeferredFunctionType();
}
if (undeferredFunctionType && !isProto && !instance->IsCrossSiteObject())
if (undeferredFunctionType && !isProto && !instance->IsCrossSiteObject() && (undeferredFunctionType->GetPrototype() == instance->GetType()->GetPrototype()))
{
Assert(undeferredFunctionType->GetIsShared());
Assert(!CrossSite::IsThunk(undeferredFunctionType->GetEntryPoint()));
Expand All @@ -40,9 +40,8 @@ namespace Js
else
{
typeHandler->SetInstanceTypeHandler(instance);
if (functionProxy && !isProto && typeHandler->GetMayBecomeShared() && !CrossSite::IsThunk(instance->GetType()->GetEntryPoint()) && !PHASE_OFF1(ShareFuncTypesPhase))
if (functionProxy && !isProto && typeHandler->GetMayBecomeShared() && !CrossSite::IsThunk(instance->GetType()->GetEntryPoint()) && !functionProxy->GetUndeferredFunctionType() && !PHASE_OFF1(ShareFuncTypesPhase))
{
Assert(!functionProxy->GetUndeferredFunctionType());
functionProxy->SetUndeferredFunctionType(ScriptFunction::UnsafeFromVar(instance)->GetScriptFunctionType());
instance->ShareType();
}
Expand Down

0 comments on commit bdd48f2

Please # to comment.