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';"+ |