Skip to content

Commit ae5abc6

Browse files
committed
Fixing build of internal projects.
1 parent 798f77b commit ae5abc6

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

lib/Runtime/Library/JavascriptProxy.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,25 @@ namespace Js
16191619
return JavascriptObject::ToStringHelper(target, scriptContext);
16201620
}
16211621

1622+
// before recursively calling something on 'target' use this helper in case there is nesting of proxies.
1623+
// the proxies could be deep nested and cause SO when processed recursively.
1624+
const JavascriptProxy* JavascriptProxy::UnwrapNestedProxies(const JavascriptProxy* proxy)
1625+
{
1626+
// continue while we have a proxy that is not revoked
1627+
while (proxy->handler != nullptr)
1628+
{
1629+
JavascriptProxy* nestedProxy = JavascriptOperators::TryFromVar<JavascriptProxy>(proxy->target);
1630+
if (nestedProxy == nullptr)
1631+
{
1632+
break;
1633+
}
1634+
1635+
proxy = nestedProxy;
1636+
}
1637+
1638+
return proxy;
1639+
}
1640+
16221641
BOOL JavascriptProxy::GetDiagTypeString(StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext)
16231642
{
16241643
const JavascriptProxy* proxy = UnwrapNestedProxies(this);

lib/Runtime/Library/JavascriptProxy.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,7 @@ namespace Js
5757

5858
// before recursively calling something on 'target' use this helper in case there is nesting of proxies.
5959
// the proxies could be deep nested and cause SO when processed recursively.
60-
static const JavascriptProxy* UnwrapNestedProxies(const JavascriptProxy* proxy)
61-
{
62-
// continue while we have a proxy that is not revoked
63-
while (proxy->handler != nullptr)
64-
{
65-
JavascriptProxy* nestedProxy = JavascriptOperators::TryFromVar<JavascriptProxy>(proxy->target);
66-
if (nestedProxy == nullptr)
67-
{
68-
break;
69-
}
70-
71-
proxy = nestedProxy;
72-
}
73-
74-
return proxy;
75-
}
60+
static const JavascriptProxy* UnwrapNestedProxies(const JavascriptProxy* proxy);
7661

7762
#ifndef IsJsDiag
7863
RecyclableObject* GetTarget();

0 commit comments

Comments
 (0)