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

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

Issue 1307943007: [es6] Fix computed property names in nested literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « 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 TestNestedLiterals() {
304 var array = [
305 42,
306 { a: 'A',
307 ['b']: 'B',
308 c: 'C',
309 [ID('d')]: 'D',
310 },
311 43,
312 ];
313 assertEquals(42, array[0]);
314 assertEquals(43, array[2]);
315 assertEquals('A', array[1].a);
316 assertEquals('B', array[1].b);
317 assertEquals('C', array[1].c);
318 assertEquals('D', array[1].d);
319 var object = {
320 outer: 42,
321 inner: {
322 a: 'A',
323 ['b']: 'B',
324 c: 'C',
325 [ID('d')]: 'D',
326 },
327 outer2: 43,
328 };
329 assertEquals(42, object.outer);
330 assertEquals(43, object.outer2);
331 assertEquals('A', object.inner.a);
332 assertEquals('B', object.inner.b);
333 assertEquals('C', object.inner.c);
334 assertEquals('D', object.inner.d);
335 var object = {
336 outer: 42,
337 array: [
338 43,
339 { a: 'A',
340 ['b']: 'B',
341 c: 'C',
342 [ID('d')]: 'D',
343 },
344 44,
345 ],
346 outer2: 45
347 };
348 assertEquals(42, object.outer);
349 assertEquals(45, object.outer2);
350 assertEquals(43, object.array[0]);
351 assertEquals(44, object.array[2]);
352 assertEquals('A', object.array[1].a);
353 assertEquals('B', object.array[1].b);
354 assertEquals('C', object.array[1].c);
355 assertEquals('D', object.array[1].d);
356 })();
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698