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

Side by Side Diff: test/mjsunit/harmony/object-spread-basic.js

Issue 2620943002: [ESnext] Implement Object Rest (Closed)
Patch Set: fix nits Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/harmony/object-rest-basic.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-object-spread 5 // Flags: --harmony-object-rest-spread
6 6
7 var x = {a: 1}; 7 var x = {a: 1};
8 var y = { ...x}; 8 var y = { ...x};
9 assertEquals(x, y); 9 assertEquals(x, y);
10 10
11 assertEquals({}, y = { ...{} } ); 11 assertEquals({}, y = { ...{} } );
12 assertEquals({}, y = { ...undefined }); 12 assertEquals({}, y = { ...undefined });
13 assertEquals({}, y = { ...null }); 13 assertEquals({}, y = { ...null });
14 14
15 assertEquals({}, y = { ...1 }); 15 assertEquals({}, y = { ...1 });
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return Object.getOwnPropertyDescriptor(z, prop); 102 return Object.getOwnPropertyDescriptor(z, prop);
103 }, 103 },
104 }); 104 });
105 assertEquals(z, y = { ...p }); 105 assertEquals(z, y = { ...p });
106 106
107 var x = { a:1 }; 107 var x = { a:1 };
108 assertEquals(x, y = { set a(_) { throw new Error(); }, ...x }); 108 assertEquals(x, y = { set a(_) { throw new Error(); }, ...x });
109 109
110 var x = { a:1 }; 110 var x = { a:1 };
111 assertEquals(x, y = { get a() { throw new Error(); }, ...x }); 111 assertEquals(x, y = { get a() { throw new Error(); }, ...x });
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/object-rest-basic.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698