Index: test/mjsunit/es6/destructuring.js |
diff --git a/test/mjsunit/es6/destructuring.js b/test/mjsunit/es6/destructuring.js |
index d15805711f0a82324acbeee48f57c0f69da73307..1f16c45270a9574d22f60865fbe1ca0377eb40e3 100644 |
--- a/test/mjsunit/es6/destructuring.js |
+++ b/test/mjsunit/es6/destructuring.js |
@@ -260,6 +260,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';"+ |