1 // This file tests is concat spreadable.
3 function arrayEq(a, b) {
4 if (a.length !== b.length)
6 for (let i = 0; i < a.length; i++) {
16 let {proxy:p, revoke} = Proxy.revocable(array, { get : function(o, k) { return o[k]; } });
18 // Test it works with proxies by default
19 for (let i = 0; i < 100000; i++) {
20 if (!arrayEq(Array.prototype.concat.call(p,p), [1,2,3,1,2,3]))
21 throw "failed normally with a proxy"
24 // Test it works with spreadable false.
25 p[Symbol.isConcatSpreadable] = false;
26 for (let i = 0; i < 100000; i++) {
27 if (!arrayEq(Array.prototype.concat.call(p,p), [p,p]))
28 throw "failed with no spread"
31 p[Symbol.isConcatSpreadable] = undefined;
35 Array.prototype.concat.call(p,[]);