Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: test/mjsunit/harmony/destructuring.js

Issue 1906633002: Version 5.0.71.34 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/pattern-rewriter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/destructuring.js
diff --git a/test/mjsunit/harmony/destructuring.js b/test/mjsunit/harmony/destructuring.js
index b6eb6eab09e8152047fb07de83ab7141e7e4392d..e84abd112f9a79557d3aa1c254f143a0c9179d0f 100644
--- a/test/mjsunit/harmony/destructuring.js
+++ b/test/mjsunit/harmony/destructuring.js
@@ -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';"+
« no previous file with comments | « src/parsing/pattern-rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698