4 <script src=
"../../resources/js-test.js"></script>
8 description("This tests the length property of functions.");
10 shouldBe('window.confirm.length', '0');
11 shouldBe('window.open.length', '2');
12 shouldBe('window.setTimeout.length', '1');
13 shouldBe('window.clearTimeout.length', '0');
14 // addEventListener.length should be 2, but legacy content calls with 0 or 1
15 // argument. See http://crbug.com/249598
16 shouldBe('window.addEventListener.length', '0');
17 shouldBe('window.postMessage.length', '2');
18 shouldBe('window.dispatchEvent.length', '1');
19 shouldBe('window.openDatabase.length', '4');
20 shouldBe('window.history.pushState.length', '2');
21 shouldBe('window.history.length', '1');
22 shouldBe('window.URL.createObjectURL.length', '1');
23 shouldBe('window.Storage.prototype.key.length', '1');
25 // One required and one optional argument
26 shouldBe('document.importNode.length', '1');
27 // One variadic argument
28 shouldBe('document.write.length', '0');
29 // Overloaded method with varying number of arguments
30 shouldBe('CanvasRenderingContext2D.prototype.drawImage.length', '3');
32 shouldBe('Array.prototype.concat.length', '1');
33 shouldBe('Array.prototype.join.length', '1');
34 shouldBe('Array.prototype.push.length', '1');
35 shouldBe('Array.prototype.slice.length', '2');
36 shouldBe('Date.UTC.length', '7');
37 shouldBe('Date.prototype.setSeconds.length', '2');
38 shouldBe('Date.prototype.setMinutes.length', '3');
39 shouldBe('Date.prototype.setHours.length', '4');
40 shouldBe('Date.prototype.setMonth.length', '2');
41 shouldBe('Date.prototype.setFullYear.length', '3');
42 shouldBe('Number.prototype.toExponential.length', '1');
43 shouldBe('Number.prototype.toFixed.length', '1');
44 shouldBe('Number.prototype.toPrecision.length', '1');
45 shouldBe('Math.max.length', '2');
46 shouldBe('Math.min.length', '2');
47 shouldBe('Function.prototype.apply.length', '2');
48 shouldBe('Function.prototype.call.length', '1');
49 shouldBe('String.prototype.split.length', '2');
50 shouldBe('String.prototype.substring.length', '2');