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

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

Issue 1338413002: Version 4.5.103.33 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5
Patch Set: 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
« 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 // Flags: --harmony-computed-property-names 5 // Flags: --harmony-computed-property-names
6 6
7 7
8 function ID(x) { 8 function ID(x) {
9 return x; 9 return x;
10 } 10 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 var o = { 293 var o = {
294 get [throwMyError()]() { return 42; } 294 get [throwMyError()]() { return 42; }
295 }; 295 };
296 }, MyError); 296 }, MyError);
297 assertThrows(function() { 297 assertThrows(function() {
298 var o = { 298 var o = {
299 set [throwMyError()](_) { } 299 set [throwMyError()](_) { }
300 }; 300 };
301 }, MyError); 301 }, MyError);
302 })(); 302 })();
303
304
305 (function TestNestedLiterals() {
306 var array = [
307 42,
308 { a: 'A',
309 ['b']: 'B',
310 c: 'C',
311 [ID('d')]: 'D',
312 },
313 43,
314 ];
315 assertEquals(42, array[0]);
316 assertEquals(43, array[2]);
317 assertEquals('A', array[1].a);
318 assertEquals('B', array[1].b);
319 assertEquals('C', array[1].c);
320 assertEquals('D', array[1].d);
321 var object = {
322 outer: 42,
323 inner: {
324 a: 'A',
325 ['b']: 'B',
326 c: 'C',
327 [ID('d')]: 'D',
328 },
329 outer2: 43,
330 };
331 assertEquals(42, object.outer);
332 assertEquals(43, object.outer2);
333 assertEquals('A', object.inner.a);
334 assertEquals('B', object.inner.b);
335 assertEquals('C', object.inner.c);
336 assertEquals('D', object.inner.d);
337 var object = {
338 outer: 42,
339 array: [
340 43,
341 { a: 'A',
342 ['b']: 'B',
343 c: 'C',
344 [ID('d')]: 'D',
345 },
346 44,
347 ],
348 outer2: 45
349 };
350 assertEquals(42, object.outer);
351 assertEquals(45, object.outer2);
352 assertEquals(43, object.array[0]);
353 assertEquals(44, object.array[2]);
354 assertEquals('A', object.array[1].a);
355 assertEquals('B', object.array[1].b);
356 assertEquals('C', object.array[1].c);
357 assertEquals('D', object.array[1].d);
358 })();
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