summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/structured-clone/Map-Set-cross-compartment.js
blob: 8ce792562e8dc7f956acbebcb2bd82a401a5a195 (plain)
1
2
3
4
5
6
7
8
9
10
11
/*
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/
 */

// Don't crash
serialize(evalcx("new Set(['x', 'y'])"));
serialize(evalcx("new Map([['x', 1]])"));

assertEq(deserialize(serialize(evalcx("new Set([1, 2, 3])"))).has(1), true);
assertEq(deserialize(serialize(evalcx("new Map([['x', 1]])"))).get('x'), 1);