Skip to content
Permalink
Browse files

deps: upgrade to V8 5.0.71.34

Pick up the latest bug fix from the V8 5.0 branch.

Original commit message:
V8-Commit: v8/v8@c36773f
  Version 5.0.71.34 (cherry-pick)
  Merged 9acbca1

  [es6] Fix bug in pattern re-writing

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

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

PR-URL: #6320
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
  • Loading branch information...
ofrobots committed Apr 21, 2016
1 parent a770a16 commit 49e42c530ba4ef2a0b580b8a64ba93511a378b75
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 0
#define V8_BUILD_NUMBER 71
#define V8_PATCH_LEVEL 33
#define V8_PATCH_LEVEL 34

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
@@ -77,7 +77,11 @@ bool Parser::PatternRewriter::IsBindingContext(PatternContext c) const {
Parser::PatternRewriter::PatternContext
Parser::PatternRewriter::SetAssignmentContextIfNeeded(Expression* node) {
PatternContext old_context = context();
if (node->IsAssignment() && node->AsAssignment()->op() == Token::ASSIGN) {
// AssignmentExpressions may occur in the Initializer position of a
// SingleNameBinding. Such expressions should not prompt a change in the
// pattern's context.
if (node->IsAssignment() && node->AsAssignment()->op() == Token::ASSIGN &&
!IsInitializerContext()) {
set_context(ASSIGNMENT);
}
return old_context;
@@ -263,6 +263,63 @@
}());


(function TestAssignmentExprInInitializers() {
{
let x, y;
{
let { x = y = 1 } = {};
assertSame(x, 1);
assertSame(y, 1);
}
assertSame(undefined, x);
assertSame(1, y);
}

{
let x, y;
{
let { x: x = y = 1 } = {};
assertSame(1, x);
assertSame(1, y);
}
assertSame(undefined, x);
assertSame(1, y);
}

{
let x, y;
{
let [ x = y = 1 ] = [];
assertSame(1, x);
assertSame(1, y);
}
assertSame(undefined, x);
assertSame(1, y);
}

{
let x, y;
(function({ x = y = 1 }) {}({}));
assertSame(undefined, x);
assertSame(1, y);
}

{
let x, y;
(function({ x: x = y = 1 }) {}({}));
assertSame(undefined, x);
assertSame(1, y);
}

{
let x, y;
(function([ x = y = 1 ]) {}([]));
assertSame(undefined, x);
assertSame(1, y);
}
}());


(function TestMultipleAccesses() {
assertThrows(
"'use strict';"+

0 comments on commit 49e42c5

Please sign in to comment.
You can’t perform that action at this time.