blob: 42774b84ed586f1ab2fec19c76959733ce1b3d92 [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001// 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})();