Skip to content

Commit d77265f

Browse files
committed
[MERGE chakra-core#955] Fix DRT issue related to HostDispatch property access
Merge pull request chakra-core#955 from pleath:7485108 My cleanup of the shortcut-property-access-on-unknown-property-name optimization relied on IsExternal() to tell us whether an object is eligible. But we must also exclude HostDispatch, which returns false on IsExternal().
2 parents 0e9576c + 8078afa commit d77265f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/Runtime/Language/JavascriptOperators.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5044,15 +5044,20 @@ namespace Js
50445044
return false;
50455045
}
50465046

5047-
if (JavascriptProxy::Is(instance) || instance->IsExternal())
5047+
TypeId typeId = instance->GetTypeId();
5048+
if (typeId == TypeIds_Proxy || typeId == TypeIds_HostDispatch)
50485049
{
50495050
return false;
50505051
}
5051-
if (DynamicType::Is(instance->GetTypeId()) &&
5052+
if (DynamicType::Is(typeId) &&
50525053
static_cast<DynamicObject*>(instance)->GetTypeHandler()->IsStringTypeHandler())
50535054
{
50545055
return false;
50555056
}
5057+
if (instance->IsExternal())
5058+
{
5059+
return false;
5060+
}
50565061
return !(instance->HasDeferredTypeHandler() &&
50575062
JavascriptFunction::Is(instance) &&
50585063
JavascriptFunction::FromVar(instance)->IsExternalFunction());

0 commit comments

Comments
 (0)