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-spread-calls | |
6 | |
7 (function testSpreadCallsStrict() { | 5 (function testSpreadCallsStrict() { |
8 "use strict" | 6 "use strict" |
9 function countArgs() { return arguments.length; } | 7 function countArgs() { return arguments.length; } |
10 | 8 |
11 // Test this argument | 9 // Test this argument |
12 function returnThis() { return this; } | 10 function returnThis() { return this; } |
13 assertEquals(void 0, returnThis(..."test")); | 11 assertEquals(void 0, returnThis(..."test")); |
14 | 12 |
15 // Test argument counting with different iterables | 13 // Test argument counting with different iterables |
16 assertEquals(0, countArgs(..."")); | 14 assertEquals(0, countArgs(..."")); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 363 |
366 assertEquals(3, returnCountStrict(...[1])); | 364 assertEquals(3, returnCountStrict(...[1])); |
367 assertEquals(4, returnCountStrict(1, ...[2])); | 365 assertEquals(4, returnCountStrict(1, ...[2])); |
368 assertEquals(5, returnCountStrict(1, ...[2], 3)); | 366 assertEquals(5, returnCountStrict(1, ...[2], 3)); |
369 assertEquals(3, returnCountSloppy(...[1])); | 367 assertEquals(3, returnCountSloppy(...[1])); |
370 assertEquals(4, returnCountSloppy(1, ...[2])); | 368 assertEquals(4, returnCountSloppy(1, ...[2])); |
371 assertEquals(5, returnCountSloppy(1, ...[2], 3)); | 369 assertEquals(5, returnCountSloppy(1, ...[2], 3)); |
372 | 370 |
373 Object.defineProperty(Array.prototype, Symbol.iterator, origIterator); | 371 Object.defineProperty(Array.prototype, Symbol.iterator, origIterator); |
374 })(); | 372 })(); |
OLD | NEW |