1 // The cache lookup must happen after ensuring there are no dense elements.
2 function testNewDenseElement() {
3 var from = {x: 1, y: 2, z: 3};
5 for (var i = 0; i < 10; i++) {
9 var to = Object.assign({}, from);
11 assertEq(JSON.stringify(to), '{"0":1,"x":1,"y":2,"z":3}');
13 assertEq(JSON.stringify(to), '{"x":1,"y":2,"z":3}');
17 testNewDenseElement();
19 // The cache lookup must happen after ensuring there are non-writable
20 // properties on the proto chain.
21 function testProtoNonWritable() {
23 var from = {x: 1, y: 2, z: 3};
25 for (var i = 0; i < 10; i++) {
30 var to = Object.create(proto);
33 Object.assign(to, from);
38 assertEq(ex instanceof TypeError, i > 5);
41 assertEq(JSON.stringify(to), '{"x":1,"y":2,"z":3}');
43 assertEq(JSON.stringify(to), '{}');
47 testProtoNonWritable();