0a92004806d131debf2397455762c8b6f944a8a5
[WebKit-https.git] / LayoutTests / js / array-species-different-globalobjects.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <iframe srcdoc="<script></script>">
8 </iframe>
9 <script>
10
11 function id(x) { return x; }
12
13 testFunctions = [
14     [Array.prototype.concat, []],
15     [Array.prototype.slice, [1,2]],
16     [Array.prototype.splice, []],
17     [Array.prototype.splice, [0,1]],
18     [Array.prototype.map, [id]],
19     [Array.prototype.filter, [id]]
20 ];
21
22 let otherArray = frames[0].Array(10);
23
24 var result;
25
26 function testFunction(testArgs) {
27     let [func, args] = testArgs;
28
29     result = func.call(otherArray, ...args);
30
31     shouldBeTrue("result instanceof Array");
32 }
33
34 testFunctions.forEach(testFunction);
35
36
37 </script>
38 <script src="../resources/js-test-post.js"></script>
39 </body>
40 </html>