Skip to content

Commit 712f1f9

Browse files
committed
need marshal in JavascriptProxy::GetValueFromDescriptor
my change chakra-core@6aa7967 revealed this bug cheery-picked from master: 764e978
1 parent bf18cec commit 712f1f9

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

lib/Runtime/Library/JavascriptProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ namespace Js
18701870
{
18711871
if (propertyDescriptor.ValueSpecified())
18721872
{
1873-
return propertyDescriptor.GetValue();
1873+
return CrossSite::MarshalVar(requestContext, propertyDescriptor.GetValue());
18741874
}
18751875
if (propertyDescriptor.GetterSpecified())
18761876
{

test/es6/proxy_cctx_bugs.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,30 @@ function test2() {
5151
sc9_cctx.test();
5252
}
5353

54+
function test3() {
55+
var obj1 = {};
56+
var arrObj0 = {};
57+
var x=1
58+
var proxyHandler = {};
59+
proxyHandler['get'] = function () {};
60+
proxyHandler['defineProperty'] = function (target, property, descriptor) {
61+
return Reflect.defineProperty(target, property, descriptor);
62+
};
63+
proxyHandler['isExtensible'] = function (target) {
64+
arrObj0.prop0;
65+
arrObj0 = new Proxy(arrObj0, proxyHandler);
66+
return Reflect.isExtensible(target);
67+
};
68+
arrObj0 = new Proxy(arrObj0, proxyHandler);
69+
arrObj0 = new Proxy(arrObj0, proxyHandler);
70+
do {
71+
var sc3 = WScript.LoadScript('function test(){arrObj0.length = arrObj0[obj1];}', 'samethread');
72+
sc3.obj1 = obj1;
73+
sc3.arrObj0 = arrObj0;
74+
sc3.test();
75+
} while (x--);
76+
}
77+
5478
test1();
55-
test2();
79+
test2();
80+
test3();

0 commit comments

Comments
 (0)