Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Flags: --harmony-do-expressions |
| 6 | |
| 7 | (function testWithoutOtherLiteral() { |
| 8 | var result = ((x = [...[42]]) => x)(); |
| 9 | assertEquals(result, [42]); |
| 10 | })(); |
| 11 | |
| 12 | (function testWithSomeOtherLiteral() { |
| 13 | []; // important: an array literal before the arrow function |
| 14 | var result = ((x = [...[42]]) => x)(); // will core dump, if not fixed. |
| 15 | assertEquals(result, [42]); |
| 16 | })(); |