Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Version 4.6.85.19 (cherry-pick)
Browse files Browse the repository at this point in the history
Merged f44efd6

Fix spread operator in ArrayLiterals when nested in other literals

BUG=v8:4417
LOG=N
R=littledan@chromium.org

Review URL: https://codereview.chromium.org/1356913005 .

Cr-Commit-Position: refs/branch-heads/4.6@{#22}
Cr-Branched-From: 24d34a8-refs/heads/4.6.85@{#1}
Cr-Branched-From: 8f44118-refs/heads/master@{#30256}
  • Loading branch information
ajklein committed Sep 18, 2015
1 parent 9b0fb52 commit 2a6fa60
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 6
#define V8_BUILD_NUMBER 85
#define V8_PATCH_LEVEL 18
#define V8_PATCH_LEVEL 19

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
2 changes: 1 addition & 1 deletion src/ast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
Strength::WEAK, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);

// Fill in the literals.
bool is_simple = true;
bool is_simple = (first_spread_index_ < 0);
int depth_acc = 1;
bool is_holey = false;
int array_index = 0;
Expand Down
12 changes: 12 additions & 0 deletions test/mjsunit/harmony/regress/regress-4417.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-spread-arrays

var arr = [1, 2, 3];
assertEquals({arr: [1, 2, 3]}, {arr: [...arr]});
assertEquals([[1, 2, 3]], [[...arr]]);

assertEquals({arr: [6, 5, [1, 2, 3]]}, {arr: [6, 5, [...arr]]});
assertEquals([8, 7, [6, 5, [1, 2, 3]]], [8, 7, [6, 5, [...arr]]]);

0 comments on commit 2a6fa60

Please sign in to comment.