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

Side by Side Diff: test/mjsunit/es6/computed-property-names.js

Issue 1307223002: [es6] fix nested object literals with computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename accessor to something that makes more sense Created 5 years, 3 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
« src/ast.h ('K') | « src/ast.cc ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 5
6 function ID(x) { 6 function ID(x) {
7 return x; 7 return x;
8 } 8 }
9 9
10 10
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 var o = { 291 var o = {
292 get [throwMyError()]() { return 42; } 292 get [throwMyError()]() { return 42; }
293 }; 293 };
294 }, MyError); 294 }, MyError);
295 assertThrows(function() { 295 assertThrows(function() {
296 var o = { 296 var o = {
297 set [throwMyError()](_) { } 297 set [throwMyError()](_) { }
298 }; 298 };
299 }, MyError); 299 }, MyError);
300 })(); 300 })();
301
302
303 (function TestNestedLiteral() {
304 var key = "test";
305 for (var i = 0; i < 10; ++i) {
306 assertEquals(i, ({ a: { [key + i]: i } }).a[key + i]);
307 assertEquals(i, ({ a: { b: { [key + i]: i } } }).a.b[key + i]);
308 assertEquals(i, ([ { [key + i]: i } ])[0][key + i]);
309 assertEquals(i, ([ { b: { [key + i]: i } } ])[0].b[key + i]);
310 }
311 })();
OLDNEW
« src/ast.h ('K') | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698