Skip to content

Commit 7337693

Browse files
ofrobotsjasnell
authored andcommitted
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>
1 parent a9bab5f commit 7337693

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 0
1313
#define V8_BUILD_NUMBER 71
14-
#define V8_PATCH_LEVEL 33
14+
#define V8_PATCH_LEVEL 34
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/parsing/pattern-rewriter.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ bool Parser::PatternRewriter::IsBindingContext(PatternContext c) const {
7777
Parser::PatternRewriter::PatternContext
7878
Parser::PatternRewriter::SetAssignmentContextIfNeeded(Expression* node) {
7979
PatternContext old_context = context();
80-
if (node->IsAssignment() && node->AsAssignment()->op() == Token::ASSIGN) {
80+
// AssignmentExpressions may occur in the Initializer position of a
81+
// SingleNameBinding. Such expressions should not prompt a change in the
82+
// pattern's context.
83+
if (node->IsAssignment() && node->AsAssignment()->op() == Token::ASSIGN &&
84+
!IsInitializerContext()) {
8185
set_context(ASSIGNMENT);
8286
}
8387
return old_context;

deps/v8/test/mjsunit/harmony/destructuring.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,63 @@
263263
}());
264264

265265

266+
(function TestAssignmentExprInInitializers() {
267+
{
268+
let x, y;
269+
{
270+
let { x = y = 1 } = {};
271+
assertSame(x, 1);
272+
assertSame(y, 1);
273+
}
274+
assertSame(undefined, x);
275+
assertSame(1, y);
276+
}
277+
278+
{
279+
let x, y;
280+
{
281+
let { x: x = y = 1 } = {};
282+
assertSame(1, x);
283+
assertSame(1, y);
284+
}
285+
assertSame(undefined, x);
286+
assertSame(1, y);
287+
}
288+
289+
{
290+
let x, y;
291+
{
292+
let [ x = y = 1 ] = [];
293+
assertSame(1, x);
294+
assertSame(1, y);
295+
}
296+
assertSame(undefined, x);
297+
assertSame(1, y);
298+
}
299+
300+
{
301+
let x, y;
302+
(function({ x = y = 1 }) {}({}));
303+
assertSame(undefined, x);
304+
assertSame(1, y);
305+
}
306+
307+
{
308+
let x, y;
309+
(function({ x: x = y = 1 }) {}({}));
310+
assertSame(undefined, x);
311+
assertSame(1, y);
312+
}
313+
314+
{
315+
let x, y;
316+
(function([ x = y = 1 ]) {}([]));
317+
assertSame(undefined, x);
318+
assertSame(1, y);
319+
}
320+
}());
321+
322+
266323
(function TestMultipleAccesses() {
267324
assertThrows(
268325
"'use strict';"+

0 commit comments

Comments
 (0)