Skip to content
Permalink
Browse files

VarIsImpl for Activationobect should include cross-site vtble checks …

…as well
  • Loading branch information...
akroshg committed Mar 11, 2019
1 parent a247f4f commit 3918240f8ea71a598a75aa14a100319f1f852cb9
Showing with 24 additions and 7 deletions.
  1. +14 −7 lib/Runtime/Types/ActivationObject.cpp
  2. +10 −0 test/Bugs/misc_bugs.js
@@ -10,11 +10,16 @@ namespace Js
{
template <> bool VarIsImpl<ActivationObject>(RecyclableObject* instance)
{
return VirtualTableInfo<Js::ActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<Js::ActivationObjectEx>::HasVirtualTable(instance) ||
VirtualTableInfo<Js::PseudoActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<Js::BlockActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<Js::ConsoleScopeActivationObject>::HasVirtualTable(instance);
return VirtualTableInfo<ActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<ActivationObject>>::HasVirtualTable(instance) ||
VirtualTableInfo<ActivationObjectEx>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<ActivationObjectEx>>::HasVirtualTable(instance) ||
VirtualTableInfo<PseudoActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<PseudoActivationObject>>::HasVirtualTable(instance) ||
VirtualTableInfo<BlockActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<BlockActivationObject>>::HasVirtualTable(instance) ||
VirtualTableInfo<ConsoleScopeActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<ConsoleScopeActivationObject>>::HasVirtualTable(instance);
}

BOOL ActivationObject::HasOwnPropertyCheckNoRedecl(PropertyId propertyId)
@@ -172,7 +177,8 @@ namespace Js

template <> bool VarIsImpl<BlockActivationObject>(RecyclableObject* instance)
{
return VirtualTableInfo<Js::BlockActivationObject>::HasVirtualTable(instance);
return VirtualTableInfo<Js::BlockActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<BlockActivationObject>>::HasVirtualTable(instance);
}

BOOL PseudoActivationObject::InitPropertyScoped(PropertyId propertyId, Var value)
@@ -211,7 +217,8 @@ namespace Js

template <> bool VarIsImpl<PseudoActivationObject>(RecyclableObject* instance)
{
return VirtualTableInfo<Js::PseudoActivationObject>::HasVirtualTable(instance);
return VirtualTableInfo<Js::PseudoActivationObject>::HasVirtualTable(instance) ||
VirtualTableInfo<CrossSiteObject<PseudoActivationObject>>::HasVirtualTable(instance);
}

#if ENABLE_TTD
@@ -155,6 +155,16 @@ var tests = [
var obj2 = {__proto__ : p}; // This should not call the getPrototypeOf
}
},
{
name: "Cross-site activation object",
body: function () {
var tests = [0, 0];
tests.forEach(function() {
var eval = WScript.LoadScript(0, "samethread").eval;
eval(0);
});
}
},
{
name: "Destructuring declaration should return undefined",
body: function () {

0 comments on commit 3918240

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.