File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -1619,6 +1619,25 @@ namespace Js
1619
1619
return JavascriptObject::ToStringHelper (target, scriptContext);
1620
1620
}
1621
1621
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
+
1622
1641
BOOL JavascriptProxy::GetDiagTypeString (StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext)
1623
1642
{
1624
1643
const JavascriptProxy* proxy = UnwrapNestedProxies (this );
Original file line number Diff line number Diff line change @@ -57,22 +57,7 @@ namespace Js
57
57
58
58
// before recursively calling something on 'target' use this helper in case there is nesting of proxies.
59
59
// 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);
76
61
77
62
#ifndef IsJsDiag
78
63
RecyclableObject* GetTarget ();
You can’t perform that action at this time.
0 commit comments