Skip to content
Permalink
Browse files

[MERGE #6014 @akroshg] VarIsImpl for Activationobect should include c…

…ross-site vtble checks as well

Merge pull request #6014 from akroshg:fix_5998
  • Loading branch information...
akroshg committed Mar 14, 2019
2 parents 0b281e7 + 3918240 commit e6e25c3a5ec0f4d2bda13eb6f9b06550d91daddb
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 e6e25c3

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.