OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-spreadcalls | 5 // Flags: --harmony-spread-calls |
6 | 6 |
7 (function testSpreadCallsStrict() { | 7 (function testSpreadCallsStrict() { |
8 "use strict" | 8 "use strict" |
9 function countArgs() { return arguments.length; } | 9 function countArgs() { return arguments.length; } |
10 | 10 |
11 // Test this argument | 11 // Test this argument |
12 function returnThis() { return this; } | 12 function returnThis() { return this; } |
13 assertEquals(void 0, returnThis(..."test")); | 13 assertEquals(void 0, returnThis(..."test")); |
14 | 14 |
15 // Test argument counting with different iterables | 15 // Test argument counting with different iterables |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 assertEquals(3, returnCountStrict(...[1])); | 366 assertEquals(3, returnCountStrict(...[1])); |
367 assertEquals(4, returnCountStrict(1, ...[2])); | 367 assertEquals(4, returnCountStrict(1, ...[2])); |
368 assertEquals(5, returnCountStrict(1, ...[2], 3)); | 368 assertEquals(5, returnCountStrict(1, ...[2], 3)); |
369 assertEquals(3, returnCountSloppy(...[1])); | 369 assertEquals(3, returnCountSloppy(...[1])); |
370 assertEquals(4, returnCountSloppy(1, ...[2])); | 370 assertEquals(4, returnCountSloppy(1, ...[2])); |
371 assertEquals(5, returnCountSloppy(1, ...[2], 3)); | 371 assertEquals(5, returnCountSloppy(1, ...[2], 3)); |
372 | 372 |
373 Object.defineProperty(Array.prototype, Symbol.iterator, origIterator); | 373 Object.defineProperty(Array.prototype, Symbol.iterator, origIterator); |
374 })(); | 374 })(); |
OLD | NEW |